How does one learn arg0 in csh

John Ruckstuhl ruck at reef.cis.ufl.edu
Mon Dec 3 04:41:56 AEST 1990


me> I'd like to test if a csh is a login shell in ~/.cshrc.  In a Bourne
me> shell, I can look at $0 and see "-sh" , but in csh, $0 substitutes "the 
me> name of the file from which command input is being read" which is an
me> error in an interactive csh.
me> "login" documentation says: Argument 0 of the command interpreter is the
me> name of the command interpreter with a leading dash ('-') prepended.
me> I am aware that if the csh !is! the login shell, then ~/.login will be 
me> sourced.

j_adams at hpfcbig.SDE.HP.COM (John Adams) writes:
>The c-shell "prompt" varaible will be set if you have a login shell.  You
>can test by:
>   if ( $?prompt )

Insufficient, I think.  prompt will also be set if one is in a subshell 
to the login shell, rather than in a login shell.

Thank you for your comments,
ruck
--
John R Ruckstuhl, Jr
University of Florida		ruck at cis.ufl.edu, uflorida!ruck



More information about the Comp.unix.shell mailing list