Problems with Job Control in csh
Kenneth B Streeter
streeter at theory.lcs.mit.edu
Tue Apr 9 23:33:44 AEST 1991
I'm having problems with trying to do job control in a csh script. I
want to be able to commence a background job (I'm using the &
metacharacter), use it for some request-handling, and then later kill
the backgrounded job.
I'm trying something like the following: (text in brackets is stuff
specific to my application, and not generally necessary)
#!/bin/csh -f
xterm -e "<my-executable>" &
# <processing deleted>
kill %1
The intent with the 'kill' is to kill the backgrounded job (the
xterm). If I do a 'jobs' before the kill, the xterm job is listed as
an active job (Running) under job control with job number [1].
However, the kill statement terminates with "%1: No such process".
What is wrong with my understanding here?
--
Kenneth B. Streeter | ARPA: streeter at im.lcs.mit.edu
MIT LCS, Room NE43-350 | UUCP: ...!uunet!im.lcs.mit.edu!streeter
545 Technology Square | (617) 253-2614 (work)
Cambridge, MA 02139 | (617) 225-2249 (home)
More information about the Comp.unix.shell
mailing list