[comp.unix.wizards] Strange C shell behaviour in 4.3BSD

richard@aiva.UUCP (08/25/87)

Can anyone explain the following behaviour?

A C shell script ("nizz") runs /bin/cat (or other program requiring input).
I suspend nizz, then put it in the background.  As expected, I get the
message 'Stopped (tty input)'.  Then I bring it into the foreground.
Now the strange bit: I get another 'Stopped (tty input)' and the process
has vanished.

This happens under 4.3 on a Vax 750.  It doesn't happen under 4.2, or
SunOS 3.2, or if I copy the 4.2 csh onto the 4.3 machine and use that.
It doesn't happen if I don't put the program in the background before
bringing it into the foreground.

Here's an example, just in case I wasn't clear:

eusip% cat nizz
#!/bin/csh
/bin/cat
eusip% ./nizz
^X
Stopped
eusip% bg
[1]    ./nizz &
[1]  + Stopped (tty input)  ./nizz
eusip% fg
./nizz

Stopped (tty input)
eusip% ps
  PID TT STAT  TIME COMMAND
14180 p1 S N   0:24 -tcsh (tcsh)
24950 p1 R N   0:00 ps
eusip%

-- 
Richard Tobin,                           JANET: R.Tobin@uk.ac.ed             
AI Applications Institute,               ARPA:  R.Tobin%uk.ac.ed@cs.ucl.ac.uk
Edinburgh University.                    UUCP:  ...!ukc!ed.ac.uk!R.Tobin