[comp.sys.ibm.pc.rt] PS - What does -ksh mean?

moore@emily.uvm.edu (Bryan Moore) (05/25/91)

Here is an example of output from a 'ps'


   PID    TTY  TIME CMD
  8571 pts/28  0:02 cu -s2400 -d 16498696585041 
 19592 pts/28  4:01 cu -s2400 -d 16498696585041 
 24426 pts/28  0:00 /bin/ksh 
 28128 pts/28  0:01 -sh 
 38877 pts/28  0:00 -ksh 
 39030 pts/28  0:00 ps 


What does the - sign mean in front of sh and ksh?

Thanks!

BRYAN R. MOORE          	    |   "Last night I had that same old dream
EMAIL: moore@uvm-gen.uvm.edu	    |    it rocked me in my sleep, it gave me
USMAIL: 12 Waybury Rd. Colchester,  |    the impression the sandman plays for 
  Vermont 05446                     |    keeps..."   Larry Norman

mike@bria.UUCP (mike.stefanik) (05/26/91)

In an article, moore@emily.uvm.edu (Bryan Moore) writes:
>What does the - sign mean in front of sh and ksh?

This means that it is a login shell.  Traditionally, the way that UNIX
shells "know" that they are login shells (thus, they execute /etc/profile
and ~/.profile, etc.) is they are invoked as such:

	execl("/bin/sh","-sh",NULL);

The first argument to execl() is the name of the image to execute, the
second argument is argv[0], and so on.  When you get a process status,
it'll show argv[0], which has the dash (which makes it easy to tell the
difference between the login shell and subshells)

-- 
Michael Stefanik, MGI Inc, Los Angeles | Opinions stated are never realistic
Title of the week: Systems Engineer    | UUCP: ...!uunet!bria!mike
-------------------------------------------------------------------------------
If MS-DOS didn't exist, who would UNIX programmers have to make fun of?

rel@mtu.edu (Robert E. Landsparger) (05/30/91)

In article <1991May24.200050.16644@uvm.edu>, moore@emily.uvm.edu (Bryan Moore) writes:
|> 
|> Here is an example of output from a 'ps'
|> 
|> 
|>    PID    TTY  TIME CMD
|>   8571 pts/28  0:02 cu -s2400 -d 16498696585041 
|>  19592 pts/28  4:01 cu -s2400 -d 16498696585041 
|>  24426 pts/28  0:00 /bin/ksh 
|>  28128 pts/28  0:01 -sh 
|>  38877 pts/28  0:00 -ksh 
|>  39030 pts/28  0:00 ps 
|> 
|> 
|> What does the - sign mean in front of sh and ksh?
|> 
|> Thanks!

In most cases that means that the "shell" was a login shell.  And will be
treated as such.  There are more things done to initialize a shell when
it is a login shell.

Bob

-- 

USER:		Can I get a list of *all* the unix commands?
CONSULTANT:	man -k - | lpr -
USER:		huh?

+-------------------------------------------------------------------------+
| Robert E. Landsparger (rel@mtu.edu) - Computing Technology Services
| Michigan Technological University, Houghton, MI 49931	(906) 487-2110
+--------------------------------------------------------------------+
| The above comments do not always represent those of my employer.
+