csh bug with the 'jobs' command

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Thu May 3 11:57:25 AEST 1984


It's not precisely a bug, more a problem of definitions:

	jobs | cat

essentially starts a subshell (it actually tries hard not to, but
I'm not sure whether it succeeds) whose output is sent into a pipe
to 'cat'.  This subshell has no "jobs" running, so no output.

More interesting is the bug in the job-printing routine that prints
"< ^A > ^A" for double &s in a job.  The job itself is remembered
correctly; the print routine is wrong.

Still more interesting, some commands misbehave when piped.  This
appears to be due to csh's attempts not to fork. 'echo | echo'
produces "Reset tty pgrp from <n1> to <n2>".  A subsequent 'jobs'
command prints '[1]     Done       echo |', but this will never be
printed by itself (i.e. you *must* use the jobs command), probably
because no child-exit signal is ever received.

The C-shell is an interesting example in how not to write code.
The user interface is fine (well, not too bad, at least :->),
and the program usually works, but O what a mess it is inside!
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Comp.unix.wizards mailing list