home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!jvnc.net!rutgers!att-out!pacbell.com!lll-winken!phoenix!busby
- From: busby@phoenix.ocf.llnl.gov (lee e busby)
- Newsgroups: comp.unix.shell
- Subject: Last background PID in CSH?
- Summary: Anybody know a good way to get the PID of the last background process?
- Message-ID: <144303@lll-winken.LLNL.GOV>
- Date: 23 Dec 92 22:12:17 GMT
- Sender: usenet@lll-winken.LLNL.GOV
- Organization: Lawrence Livermore National Laboratory
- Lines: 9
- Nntp-Posting-Host: phoenix.ocf.llnl.gov
-
- Seems like it should be easy, but I can't figure out a good way to
- do it. Inside of a CSH script, I start up a command and put it in
- the background. Later on, I want to come back and kill the
- backgrounded process. How to refer to it? (It's easy with the
- Bourne shell, of course.)
-
- Right now, the best I have come up with is to start the process,
- then run "jobs -l" and parse the output with awk to get the PID.
- Surely there's a smarter way....
-