How to set global environment variables using shell script .sh

前端 未结 3 763
眼角桃花
眼角桃花 2021-01-17 06:01

I have a .sh file that locally sets some environment variables in my shell source my_env.sh.

#!/bin/sh
echo \"Setting up local env         


        
3条回答
  •  野的像风
    2021-01-17 06:28

    According to Ubuntu env variables doc the best way would be

    A suitable file for environment variable settings that affect the system as a whole (rather than just a particular user) is /etc/environment

    That's assuming you don't mind having them set for the whole machine.

提交回复
热议问题