Parsing loginshell and no-loginshellloginshell: The Complete logon process is required for obtaining bash, which is called loginshell. For example, tty1 ~ When logging on to tty6, you need to enter the user name and password. the obtained bash is called loginshellnon-logins... parse login shell and no-login shell: the complete logon process is required for obtaining bash, which is called login shell. For example, tty1 ~ When logging on to tty6, you need to enter the user name and password. the obtained bash is called login shell non-login shell: the method for obtaining the bash interface does not require repeated login. Take two examples (1) after logging on to linux using X window, start the terminal with the graphical interface of X. At this time, the terminal does not need to enter the user name and password again, the bash environment is called non-login shell (2). in the original bash environment, the command bash is issued again, and the user name and password are not required, the second bash is also the execution sequence of non-login shell and no-login shell: Login shells:/etc/profile. d ~ /. Bash_profile ~ /. Bashrc/etc/bashrc Non-login shells :~ /. Bashrc/etc/profile. d note:/etc/profile: the entire system environment is ~ Is personal settings, usually placed in ~ /. Bashrc can run scripts in the current directory in two ways. /script. sh (requires executable permissions) (1) generate a new bash to execute bash, for example :. /script. sh (you must have the executable permission ). In this case, the changes to the environment variables of the script are only valid for bash. (2) you can use the source command to directly execute the script (available '. 'to replace source ). it has two differences with the above method: 1. the script file does not require execution permissions. 2. execute in the current bash. bash does not fork a subbash to execute it. Therefore, changes to the environment variables of the script will affect the current bash. if you want to make the modified environment variable take effect, use source.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service