find out what type of shell you are in interactive or non interactive

https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch

[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'
shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'

Leave a Reply

Your email address will not be published.