home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / sgi / 19035 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  1.4 KB

  1. Path: sparky!uunet!olivea!sgigate!odin!fido!sam.wpd.sgi.com!pj
  2. From: pj@sam.wpd.sgi.com (Paul Jackson)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: Shell script problem
  5. Message-ID: <1joc3bINN7qp@fido.asd.sgi.com>
  6. Date: 22 Jan 93 08:43:23 GMT
  7. References: <81288@hydra.gatech.EDU>
  8. Reply-To: pj@sgi.com
  9. Organization: Silicon Graphics, Research & Development
  10. Lines: 31
  11. NNTP-Posting-Host: sam.wpd.sgi.com
  12.  
  13. In article <81288@hydra.gatech.EDU>, ccoprrm@prism.gatech.EDU (Robert E. Minsk) writes:
  14. |>   I have a shell script that creates a temporary directory writes some files
  15. |> to the directory then does a rm -rf "directory".  The files are removed but
  16. |> the directory remains.  If I try to do a rmdir in the shell script it 
  17. |> return "Directory not empty".  Parts of the shell script is listed below.
  18. |> 
  19. |> #!/bin/sh
  20. |> SLATEDIR=/usr/tmp/slate.$$
  21. |> trap "rm -rf $SLATEDIR" 0 1 2 3 15
  22. |> mkdir $SLATEDIR
  23. |> "write some stuff in $SLATEDIR"
  24. |> exit 0
  25.  
  26. The following works fine for me on 4.0.5:
  27.  
  28.     #!/bin/sh
  29.     SLATEDIR=/usr/tmp/slate.$$
  30.     trap "rm -fr $SLATEDIR" 0 1 2 3 15
  31.     mkdir $SLATEDIR
  32.     touch $SLATEDIR/a
  33.     exit 0
  34.  
  35. Try it -- if it works for you, then the part about "write some
  36. stuff in $SLATEDIR" must be relevant.  If it doesn't work
  37. verbatim for you, then somethings WREK'd.
  38.  
  39. -- 
  40.  
  41.                 I won't rest till it's the best ...
  42.                 Software Production Engineer
  43.                 Paul Jackson (pj@sgi.com), x1373
  44.