> Just take the output from ps -x (or -f if on system V) grep for pid $$ > and check if the command name begins with a '-'. If that is the case the > shell is the login shell. How about just comparing $0.