Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rutgers!gatech!uflorida!reef.cis.ufl.edu!ruck From: ruck@reef.cis.ufl.edu (John Ruckstuhl) Newsgroups: comp.unix.shell Subject: Re: How does one learn arg0 in csh Message-ID: <25688@uflorida.cis.ufl.EDU> Date: 2 Dec 90 17:41:56 GMT References: <25611@uflorida.cis.ufl.EDU> <13830001@hpfcbig.SDE.HP.COM> Sender: news@uflorida.cis.ufl.EDU Organization: UF CIS Dept. Lines: 23 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@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@cis.ufl.edu, uflorida!ruck