How does a shell know if it's in the foreground or the background?

LEWIS WILLIAM M JR lewis at tramp.Colorado.EDU
Fri Apr 26 05:41:19 AEST 1991


In the Bourne shell AND if not more than one background job is running

	if [ "$$" -eq "$!" ]

will be true if the job is in the background.



More information about the Comp.unix.questions mailing list