Does not read variables in files with bash through/.profile
or through/.bash_profile
.
For example, in .bash_profile
,
export x=100
echo$x
does not print a value of x.
The /etc/profile
setting is
#System-wide.profile for sh(1)
if [-x/usr/libexec/path_helper]; then
val`/usr/libexec/path_helper-s`
fi
if ["${BASH-no}"!="no"; then
[-r/etc/bashrc] & ./etc/bashrc
fi
is shown in .
bash
By default, through /.profile
and through /.bash_profile
are read when the login shell boots.
Booting as a login shell like bash-l
or bash--login
will work as desired.
At that time, sh
used .profile
at startup.
Currently bash
attempts to load .bash_profile
first. However, if it does not exist, load .profile
If bash
boots as sh
(for example, /bin/sh
is a link to /bin/bash
), or if it boots with the --posix
flag, try to emulate .profile
So try using ~/.bash_profile
directly
The environment variables described in ~/.bash_profile
are enabled by:
su-
*Not enabled on su
source~/.bash_profile
or .~/.bash_profile
If you write through /.bashrc
, it will run every time bash is started.
As Renya Gaikon replied, ~/.profile
and ~/.bash_profile
seem to be loaded only when logging in.
After logging in, bash runs through /.bashrc
in the current shell.
stThis is the result of starting bash in trace.
~/.bashrc
in my environment runs /etc/bashrc
in the current shell.. .bashrc remains the default
The following environments were tried:
CentOS Linux release 8.0.1905(Core)
GNU bash, version 4.4.19(1)-release(x86_64-redhat-linux-gnu)
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
581 PHP ssh2_scp_send fails to send files as intended
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.