Ask Your Question
1

Fedora28 ENV variable

asked 2018-05-14 07:11:12 -0600

dereke gravatar image

I just upgraded from 27->28 One of my programs that depended on an environment variable called ENV stopped working. It looks like fedora now sets this variable in /usr/share/Modules/init/bash I need to change my program so that it doesn't conflict with this - but in the short term what would be the impact of removing this variable? What does it actually do?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-14 12:33:18 -0600

villykruse gravatar image

From the file /usr/share/Modules/init/bash:

# setup ENV variables to get module defined in sub-shells (works for 'sh'
# and 'ksh' in interactive mode and 'sh' (zsh-compat), 'bash' and 'ksh'
# (zsh-compat) in non-interactive mode.
ENV=/usr/share/Modules/init/profile.sh; export ENV
BASH_ENV=/usr/share/Modules/init/bash; export BASH_ENV

In other words: it arranges for bash to use /usr/share/Modules/init/profile.sh instead of /etc/profile to set up misc variable and settings.

Do you need the environment-modules module? If not, it can be removed.

The environment variable ENV should be considered reserved of the exclusive use by the shell.

edit flag offensive delete link more

Comments

Thanks - I also found this information about POSIX mode https://www.gnu.org/software/bash/man... So it seems you are right about ENV being reserved

dereke gravatar imagedereke ( 2018-05-15 03:48:02 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-14 07:11:12 -0600

Seen: 676 times

Last updated: May 14 '18