How to set global environment variables using shell script .sh

前端 未结 3 767
眼角桃花
眼角桃花 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 06:22

    export your variables in the "/etc/profile".

    NOTE: This will make it global for each shell sessions for any user. If you wish to set this variable for every session for a specific user, set it in that user's "~/.profile".

提交回复
热议问题