I think I understand the differences between an interactive, a login and a batch shell. See the following links for more help:
- What is the difference between a 'Login' and an 'Interactive' bash shell (from the sister site: serverfault.com)
- 2.1: Types of shell: interactive and login shells (from A User's Guide to the Z-Shell)
My question is, how can I test with a command/condition if I am on an interactive, a login or a batch shell?
I am looking for a command or condition (that returns
false) and that I could also place on an if statement. For example:
if [[ condition ]] echo "This is a login shell" fi