home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / shell / 3464 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  1.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!usc!sdd.hp.com!swrinde!mips!decwrl!gossip.pyramid.com!aquila.sni-usa.com!abyss.sni-usa.com!corrado
  2. From: corrado@abyss.sni-usa.com (Corrado Giacomini)
  3. Newsgroups: comp.unix.shell
  4. Subject: How to return a job in foreground from shell script
  5. Message-ID: <1992Aug12.141629.537@aquila.sni-usa.com>
  6. Date: 12 Aug 92 14:16:29 GMT
  7. Sender: news@aquila.sni-usa.com (news USE only)
  8. Reply-To: corrado@abyss.sni-usa.com (Corrado Giacomini)
  9. Organization: Siemens-Nixdorf Information Systems, Inc. Cambridge, MA
  10. Lines: 19
  11. Nntp-Posting-Host: abyss.sni-usa.com
  12.  
  13. I need to write a script which has to put a job in background, 
  14. susped the execution of the job,  continue the job execution in 
  15. background, and finally quit it.
  16. What i tryed is this:
  17. pgm  &
  18. /bin/ps -e | grep "pgm" | awk '{ print $1 }' | xargs kill -TSTP
  19. /bin/ps -e | grep "pgm" | awk '{ print $1 }' | xargs kill -CONT
  20. /bin/ps -e | grep "pgm" | awk '{ print $1 }' | xargs kill -QUIT  
  21.  
  22. but  what I got  is only a stopped job,  the QUIT signal then 
  23. quit the job and produces a core ??
  24. Is there a way for example to place for example the job in
  25. foreground from shell script like using  fg command ?
  26.  
  27. -------------------------------------------------
  28. Corrado Giacomini
  29. email corrado@sni-usa.com
  30.            giacomin@dnc1.ico.olivetti.com
  31. -------------------------------------------------
  32.