This question already has an answer here:
I have updated the question after an answer to a related question : see the later pragraphs.
When I startup
spacemacs I get the following warning:
You appear to be setting environment variables ("PATH") in your .bashrc or .zshrc: those files are only read by interactive shells, so you should instead set environment variables in startup files like .profile, .bash_profile or .zshenv. Refer to your shell's man page for more info. Customize
exec-path-from-shell-arguments' to remove "-i" when done, or disableexec-path-from-shell-check-startup-files' to disable this message
Does this warning refer to the
PATH variable specifically or does it refer to all environment variables? The message seems to assume that login shells are the ones where environment variables to be set.
If that is the case what are the kind of settings are appropriate for the configuration files for interactive shells , ie
.bashrc, as opposed to those in
.profile which depend or are related to an established user identity?
After asking at emacs stackexchange I have learned the message is set by an
emacslibrary which copies environment settings from
.profile to make them available to scripts run by
The warning suggests that environment variables set in
.bashrc are not available to scripts (which are non-interactive shells) but those in
Does that mean that environment variables set in
.bashrc will not be available to a script run via
#!/bin/sh even if
/bin/sh is linked to
bash, or even if the script is run via