home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!news.univie.ac.at!hp4at!rcvie!rcsw68!es_macar
- From: es_macar@rcvie.co.at (Gilles Macario-Rat)
- Subject: Re: How to detect login shell in .cshrc ?
- Message-ID: <1992Aug26.122328.25528@rcvie.co.at>
- Keywords: csh login ps
- Sender: usenet@rcvie.co.at (Network News (SYSTEM))
- Nntp-Posting-Host: rcsw68.rcvie.co.at
- Reply-To: es_macar@rcvie.co.at
- Organization: Alcatel ELIN Research
- References: <1992Aug17.224225.21915@mcnews.mcdata.com>
- Date: Wed, 26 Aug 1992 12:23:28 GMT
- Lines: 59
-
- My login shell is csh on a SunOS 4.1.2 system
- rcsw68% uname -a
- SunOS rcsw68 4.1.2 4 sun4c
- rcsw68% ps $$
- PID TT STAT TIME COMMAND
- 22682 co S 0:04 -csh (csh)
- rcsw68% ps
- PID TT STAT TIME COMMAND
- 23540 co R 0:00 ps
- rcsw68% csh -f
- rcsw68% ps $$
- PID TT STAT TIME COMMAND
- 23541 co S 0:00 -sh -f (csh)
-
- In the ps man pages:
-
- ps displays the process ID, under PID; the control terminal
- (if any), under TT; the cpu time used by the process so far,
- including both user and system time), under TIME; the state
- of the process, under STAT; and finally, an indication of
- the COMMAND that is running.
- ^^^^^^^^^
-
- In the csh man pages:
-
- Initialization and Termination
- When first started, the C shell normally performs commands
- from the .cshrc file in your home directory, provided that
- it is readable and you either own it or your real group ID
- matches its group ID. If the shell is invoked with a name
- that starts with `-', as when started by login(1), the shell
- ^^^^^^^
- runs as a login shell. In this case, after executing com-
- mands from the .cshrc file, the shell executes commands from
- the .login file in your home directory; the same permission
- checks as those for .cshrc are applied to this file. Typi-
- cally, the .login file contains commands to specify the ter-
- minal type and environment.
-
- In the login man pages:
-
- login initializes the user and group IDs and the working
- directory, then starts a command interpreter shell (usually
- either sh(1) or csh(1)) according to specifications found in
- the file /etc/passwd. Argument 0 of the command interpreter
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- is the name of the command interpreter with a leading dash
- (`-') prepended.
- ^^^^^^^^
-
-
- Could anyone explain what is:
-
- + "an indication of the COMMAND that is running"
- + "Argument 0 of the command interpreter" ?
-
- Is there a way to know whether a shell is a login shell ?
-
-
-