How does one learn arg0 in csh

John Ruckstuhl ruck at reef.cis.ufl.edu
Wed Nov 28 15:44:29 AEST 1990


I'd like to test if a csh is a login shell in ~/.cshrc.  In a Bourne
shell, I can look at $0 and see "-sh" , but in csh, $0 substitutes "the 
name of the file from which command input is being read" which is an
error in an interactive csh.

"login" documentation says: Argument 0 of the command interpreter is the
name of the command interpreter with a leading dash ('-') prepended.

I am aware that if the csh !is! the login shell, then ~/.login will be 
sourced.

I am using the csh shipped with SunOS 4.1 on SPARCStation1+'s.
"what `which csh`" shows a lot of revision info -- perhaps this line
identifies the version sufficiently:
        sh.c 1.22 89/05/22 SMI; from UCB 5.3 3/29/86

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