Why my command of bash shell is not working? -
i add environment value in ~/.profile
export test1="abc"
i execute bash shell script go.sh
#!/bin/bash source ~/.profile
but result of go.sh not working.(can't find test1 variable).
set | grep test1
otherwise when execute go.sh in command line, working. (can find test1) why go.sh not working?
when execute script, new process created own environment. when prompt back, script finished, , cannot access variables.
you have source script:
source go.sh
if want shortcut reading profile, use alias
:
alias go='source ~/.profile'
Comments
Post a Comment