How to get login shell pid's

Philip Steen pds at mit-vax.UUCP
Sun Sep 29 12:16:06 AEST 1985


In article <4 at andromeda.UUCP> version B 2.10.2 9/18/84; site mit-vax.UUCP version B 2.10.3 4.3bsd-beta 6/6/85; site andromeda.UUCP mit-vax!mit-eddie!think!harvard!seismo!columbia!topaz!andromeda!dave dave at andromeda.UUCP (Dave Bloom) writes:
>... what's the best way to get the pid of a users login shell?
>... can it be done similarly in 4.2 BSD?

Sure it can.  The shell variable $$ gets the pid for you, use it thusly in
the C-Shell:

	set pid=$$
	echo "the pid of this shell is $$"

One can do something similar in the Bourne Shell.



More information about the Comp.unix mailing list