Contents
What is difference between shell script and bash script?
Shell scripting is scripting in any shell, whereas Bash scripting is scripting specifically for Bash. In practice, however, “shell script” and “bash script” are often used interchangeably, unless the shell in question is not Bash.
Is bash an interactive shell?
A bash shell is considered as an interactive shell when it reads and writes data from a user’s terminal. Most startup scripts examine the shell variable called PS1.
What is interactive mode bash?
An interactive shell reads commands from user input on a tty. The user can interact with the shell. A shell running a script is always a non-interactive shell. All the same, the script can still access its tty. It is even possible to emulate an interactive shell in a script.
What’s the difference between a login shell and interactive Bash?
If a shell script (a file containing shell commands) is run, then it is neither a login shell nor an interactive one. Start-up files are highly tailorable in bash:
What’s the difference between shell scripting and bash scripting?
Shell scripting is scripting in any shell, whereas Bash scripting is scripting specifically for Bash. In practice, however, “shell script” and “bash script” are often used interchangeably, unless the shell in question is not Bash.
What’s the difference between Bash and zsh for login?
All that changes is that zsh will be the default login shell for new accounts, and even then, you can select bash instead. Scripts are not affected. What changes is the shell for interactive use, i.e. the shell in terminals (and also a few other things that use the login shell, such as crontabs).
What does it mean to start Bash in interactive mode?
An interactive shell is one started without non-option arguments and without the -c option whose standard input and error are both connected to terminals (as determined by isatty (3)), or one started with the -i option. PS1 is set and $- includes i if bash is interactive, allowing a shell script or a startup file to test this state.