I have looked at some of the .bashrc and .profile scripts that come with various Linux distributions, and I see that sometimes they check $- .
Here is one in Ubuntu
case $- in *i*) ;; *) return;; esac
In this case, it checks for the presence of the "i" flag to see if the current shell is interactive.
My current session gives me the following:
# echo $- himBH
What do other flags / options mean? Is there an exhaustive list somewhere?
source share