Contents
What is non-interactive shell?
A non-interactive shell is a shell that can not interact with the user. It’s most often run from a script or similar. This means that . It is always a good practice to use the full path for a command but even more so in non-interactive shells.
What is interactive vs non-interactive shell?
A shell running a script is always a non-interactive shell. Simply put: Interactive shell require user input, while non-interactive shell are run by scripts and don’t require user inputs.
How do you make a user non-interactive?
Go to Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment and put your user account into the “Deny log on Locally” and “Deny log on through Remote Desktop Services” lists.
What’s the difference between a non login shell and an interactive shell?
non-login shell: A shell that is executed without logging in, necessary for this is a current logged in user. When you open a graphic terminal in gnome it is a non-login (interactive) shell. interactive shell: A shell (login or non-login) where you can interactively type or interrupt commands.
What’s the difference between non-login and non-interactive Bash?
When a shell script is run, it is executed in a non-login, non-interactive shell. Depending on how the session is launched, the bash shell reads several configuration files. One difference between distinct sessions is whether the shell is being invoked as non-login or as a login session.
How to create a non-interactive shell environment?
What you forgot to mention is how does a user connect… and so he has a TTY ( or whaterver…) defined and keyboard, StdIn and StdOut are set to those… what do you expect a non interactive shell to use as INPUT and output? What will the non-interactive shell do when in the user env it reads TERM=VT100 or export DISPLAY=…. etc…
How to run bashrc in a non-interactive shell?
In general, $HOME/.bashrc is executed for non-interactive login shells, but no script can be guaranteed to run for a non-interactive non-login shell. You can force it by setting (and exporting!) BASH_ENV from a parent shell to the name of a script which you want to execute when a non-interactive shell is started.