Loginshell or not

  • Canada
  • Windows
  • Mozilla Thunderbird
Sometimes it is useful in a script to know if you are running a login shell or not, in
bash, you can get that information using the
shopt function. For example

if shopt -q login_shell ; then
echo "login"

will only echo login if you are in a login shell..

This is one of the many other tricks that exist:


Stefan Michalowski
Email: mitch(à)ptaff.ca
PGP Key: http://screamerone.zapto.org/k.asc


Propulsé par xhtmail