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

  1. Path: sparky!uunet!gatech!prism!ccoprrm
  2. From: ccoprrm@prism.gatech.EDU (Robert E. Minsk)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Shell script problem
  5. Summary: rm not removing directories
  6. Message-ID: <81288@hydra.gatech.EDU>
  7. Date: 22 Jan 93 07:52:40 GMT
  8. Organization: Information Technology - High Performace Computing
  9. Lines: 21
  10.  
  11.  
  12.   I have a shell script that creates a temporary directory writes some files
  13. to the directory then does a rm -rf "directory".  The files are removed but
  14. the directory remains.  If I try to do a rmdir in the shell script it 
  15. return "Directory not empty".  Parts of the shell script is listed below.
  16.  
  17. #!/bin/sh
  18. SLATEDIR=/usr/tmp/slate.$$
  19. trap "rm -rf $SLATEDIR" 0 1 2 3 15
  20. mkdir $SLATEDIR
  21. "write some stuff in $SLATEDIR"
  22. exit 0
  23.  
  24.   The files are removed but not the directory.  So I tried changing the trap to
  25. trap "rm -rf $SLATEDIR;rmdir $SLATEDIR" 0 1 2 3 15, but then it returns
  26. Directory not empty.  Is this a problem with my shell script or with 4.0.5a?
  27. -- 
  28. Robert E. Minsk - DESIGNefx    | After WREKage their is Ruins...   |
  29. ARPA: ccoprrm@prism.gatech.edu    | Fridays at 10pm WREK Atlanta 91.1 |
  30. uucp: ...!{allegra,amd,hplabs,seismo,ut-ngp}!gatech!prism!ccoprrm
  31. Georgia Institute of Technology, Atlanta Georgia, 30332 
  32.