Bash-shell startup file

Source: Internet
Author: User
Bash-shell startup file Linux uses environment variables to identify itself in programs and scripts. This provides a simple way for your program to obtain system information. The question is how to set these variables. When you log on to the Linux system to start a bashshell, by default, bash identifies itself in programs and scripts in the Linux system with environment variables in the startup file of several... Bash-shell. This provides a simple way for your program to obtain system information. The question is how to set these variables. When you log on to Linux and start a bash shell, bash searches for and runs commands in several files by default. These files are called Startup Files. The startup file for bash check depends on how you start the bash shell. There are three methods to start bash shell: use the default login shell as the interactive shell for non-login shell as the non-interactive shell for running the script to log on to the shell. when you log on to Linux, bash shell is started as the login shell. Log on to the shell and read the command from four different startup files. The following is the order in which the bash shell processes these files:/etc/profile $ HOME /. bash_profile $ HOME /. bash_login $ HOME /. in profile, the bash shell is the main startup file of the default bash shell on the system. This file is executed when every user logs on to the system. The other three are proprietary to users and can be customized. Interactive shell if your bash shell is not started when you log on to the system (for example, you can press bash at the command line prompt), the shell you start is called interactive shell. The interactive shell does not run like the login shell, but it still provides a command line prompt to enter the command. The interactive shell will not access the/etc/profile file, but will check whether. bashrc exists in the user's HOME directory and execute it. $ HOME/. bashrc the last type of non-interactive shell is non-interactive shell. This shell is used when the system executes shell scripts. Its startup file is specified by the BASH_ENV environment variable. The variable is empty by default. $ BASH_ENV
Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.