home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / shell / 3629 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.5 KB  |  74 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!news.univie.ac.at!hp4at!rcvie!rcsw68!es_macar
  3. From: es_macar@rcvie.co.at (Gilles Macario-Rat)
  4. Subject: Re: How to detect login shell in .cshrc ?
  5. Message-ID: <1992Aug26.122328.25528@rcvie.co.at>
  6. Keywords: csh login ps
  7. Sender: usenet@rcvie.co.at (Network News (SYSTEM))
  8. Nntp-Posting-Host: rcsw68.rcvie.co.at
  9. Reply-To: es_macar@rcvie.co.at
  10. Organization: Alcatel ELIN Research
  11. References: <1992Aug17.224225.21915@mcnews.mcdata.com>
  12. Date: Wed, 26 Aug 1992 12:23:28 GMT
  13. Lines: 59
  14.  
  15. My login shell is csh on a SunOS 4.1.2 system
  16. rcsw68% uname -a 
  17. SunOS rcsw68 4.1.2 4 sun4c
  18. rcsw68% ps $$
  19.   PID TT STAT  TIME COMMAND
  20. 22682 co S     0:04 -csh (csh)
  21. rcsw68% ps
  22.   PID TT STAT  TIME COMMAND
  23. 23540 co R     0:00 ps
  24. rcsw68% csh -f
  25. rcsw68% ps $$
  26.   PID TT STAT  TIME COMMAND
  27. 23541 co S     0:00 -sh -f (csh)
  28.  
  29. In the ps man pages:
  30.  
  31.      ps displays the process ID, under PID; the control  terminal
  32.      (if any), under TT; the cpu time used by the process so far,
  33.      including both user and system time), under TIME; the  state
  34.      of  the  process,  under STAT; and finally, an indication of
  35.      the COMMAND that is running.
  36.     ^^^^^^^^^
  37.  
  38. In the csh man pages:
  39.  
  40.   Initialization and Termination
  41.      When first started, the C shell normally  performs  commands
  42.      from  the  .cshrc file in your home directory, provided that
  43.      it is readable and you either own it or your real  group  ID
  44.      matches  its  group  ID. If the shell is invoked with a name
  45.      that starts with `-', as when started by login(1), the shell
  46.              ^^^^^^^
  47.      runs  as  a login shell.  In this case, after executing com-
  48.      mands from the .cshrc file, the shell executes commands from
  49.      the  .login file in your home directory; the same permission
  50.      checks as those for .cshrc are applied to this file.   Typi-
  51.      cally, the .login file contains commands to specify the ter-
  52.      minal type and environment.
  53.  
  54. In the login man pages:
  55.  
  56.      login initializes the user and group  IDs  and  the  working
  57.      directory,  then starts a command interpreter shell (usually
  58.      either sh(1) or csh(1)) according to specifications found in
  59.      the file /etc/passwd.  Argument 0 of the command interpreter
  60.               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  61.      is the name of the command interpreter with a  leading  dash
  62.      (`-') prepended.
  63.     ^^^^^^^^
  64.  
  65.  
  66. Could anyone explain what is:
  67.  
  68.     + "an indication of the COMMAND that is running"
  69.     + "Argument 0 of the command interpreter" ?
  70.  
  71. Is there a way to know whether a shell is a login shell ?
  72.  
  73.  
  74.