csh script interruptability

bruner bruner
Fri Nov 12 18:45:12 AEST 1982


Another problem which I've experienced, which may or may not be
related, is the inability to correctly do "cmd1 && cmd2".  For
instance, if I type "sleep 100 && who" and don't touch my
terminal, it will indeed sleep for 100 seconds and then run
"who".  If, however, I type a ^Z, the "sleep" is stopped (even
though it hasn't finished running yet) and the "who" runs
immediately.  The signal processing code in "csh" is definitely not
doing something correctly.

An even worse problem is running such a command in the background.
For instance "sleep 100 && who &" locks up my terminal for 100
seconds because the CSH apparently waits for the spawned commands
to finish, and the commands run in a different process group than
the base level shell (hence interrupt, quit, and stop signals that
the tty driver generates are ineffective).  I can use the syntax
I'd use in the Bourne shell: "(sleep 100 && who)&" -- this works, but
when I type "jobs" it prints garbage for the command name.

--John Bruner
  Purdue/EE



More information about the Comp.bugs.4bsd.ucb-fixes mailing list