interactive/non-interactive, login/non-login shells
2015-08-26 23:25
726 查看
Bash Reference Manual - GNU
What is the difference between interactive shells, login shells, non-login shell and their use cases?
Difference between Login Shell and Non-Login Shell?
Cygwin Bash.exe vs. mintty.exe
If you run
interactive/non-interactive
An interactive shell reads commands from user input on a tty. Among other things, such a shell reads startup files on activation, displays a prompt, and enables job control by default. The user can interact with the shell.
login/non-login
A login shell is one whose first character of argument zero is
When Bash is invoked as an interactive login shell, or as a non-interactive shell with the
What is the difference between interactive shells, login shells, non-login shell and their use cases?
Difference between Login Shell and Non-Login Shell?
Cygwin Bash.exe vs. mintty.exe
If you run
bash.exeor
mintty.exewithout options, you just get the naked shell, with its default configuration, which means it doesn’t do things like add the Cygwin
/binto your
PATH.
interactive/non-interactive
An interactive shell reads commands from user input on a tty. Among other things, such a shell reads startup files on activation, displays a prompt, and enables job control by default. The user can interact with the shell.
login/non-login
A login shell is one whose first character of argument zero is
-, or one invoked with the
--loginoption.
When Bash is invoked as an interactive login shell, or as a non-interactive shell with the
--loginoption, it first reads and executes commands from the file
/etc/profile, if that file exists. After reading that file, it looks for
~/.bash_profile,
~/.bash_login, and
~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. When a login shell exits, Bash reads and executes commands from the file
~/.bash_logout, if it exists.
相关文章推荐
- linux shell 之if-------用if做判断
- linux shell 之if-------用if做判断
- [Shell]Bash变量:自定义变量 & 环境变量 & 位置参数变量 & 预定义变量
- shell中if条件字符串、数字比对,[[ ]]和[ ]区别
- 使用shell脚本检测lvs中realserver状态,并实现自动删除已挂机主机
- shell 脚本编程
- PowerShell管理Hyper-V(Windows2008R2)
- Office 365 IT Professional——如何用PowerShell创建Site Collection?
- SharePoint PowerShell命令系列 (12) New-SPWebApplication
- SharePoint PowerShell命令系列 (11) Remove-SPWeb
- SharePoint PowerShell命令系列 (10) Get-SPWeb & Set-SPWeb
- SharePoint PowerShell命令系列 (9) New-SPWeb
- SharePoint PowerShell命令系列 (8) Remove-SPSite
- SharePoint PowerShell命令系列 (7) Move-SPSite
- SharePoint PowerShell命令系列 (6) Get-SPSite & Set-SPSite
- SharePoint PowerShell命令系列 (5) New-SPSite
- SharePoint PowerShell命令系列 (4) Get-SPSolution
- SharePoint PowerShell命令系列 (3) 操作WSP解决方案包的相关命令
- bash_profile打不开怎么办,用nano .bash_profile打开
- SharePoint PowerShell命令系列 (2) Export-SPWeb & Import-SPWeb