You need to export the environment variable so that it is inherited/available to sub shells. Add export MFE_HOME
in your .profile.
How to let shell sh known ksh's environment variable
-
24-06-2022 - |
Question
system: AIX6
default shell is ksh
in ~/.profile, set the env var MFE_HOME:
MFE_HOME=/home/mfe/MFE
then exec some shell scripts, "sh xxx.sh", which will judge $MFE_HOME exists or not, and it finds not.
-----> how to let it find ~/.profile 's env var $MFE_HOME?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow