Logon/non-logon, interactive/non-interactive Shell

Source: Internet
Author: User

Login vs. Non-logon Shell:

Distinction: Whether you need to enter a username password.

Transformation:

Non-login can be converted to login using--login

Consider the conversion situation, the relatively scientific distinction: neither the password, nor the use of--login conversion of logins, the others are logged in.

The difference between a login and a non-logon run Shell:

For bash, the login shell first reads and executes the commands in the/etc/profile global configuration file, and then looks for the three profiles ~/.bash_profile, ~/.bash_login, and ~/.profile in turn. Reads and executes commands in the first of these three files that exist and are readable. Unless prohibited by the "–noprofile" option.

In a non-login shell, reading only ~/.BASHRC (and/ETC/BASH.BASHRC,/ETC/BASHRC) files may vary from one distribution to another.


Interactive vs. Non-interactive Shell:

Distinction: whether to interact with the user (executed on the terminal, the shell waits for your input, and executes the commands you submit immediately.) )

The difference between interactive and non-interactive Shell runtimes:

When a process is opened under an interactive shell, the work control job controls (which affect the number of its child process group, the process opened by the shell in Job control mode, the process group number is the process number), will not be enabled (its open Process group number inherits the process group of the parent process). A non-interactive shell process that runs both scripts. This is the Linux in the job control design, I am ready to discuss another article. In a shell script, using SET-M can change the running mode of the script to open work control.


Whether to log in and interact is the concept of two dimensions, and all four of the 22 combinations will appear:

1, login interactive most common login system after the operation of the shell used.

2. Non-logon non-interactive common shell script operation mode.

3. Non-login interactive use bash in the shell to pull up the shell, open command-line tools in the system, and so on.

4, login not interactive forced to use the login method open shell script. You can change the global file that the script accesses, and in many cases you need to use it (the remote uses the global environment where the non-logon shell invokes the script but needs to log in).

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.