home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / sysadmin / 4663 < prev    next >
Encoding:
Text File  |  1992-08-14  |  1.6 KB  |  54 lines

  1. Newsgroups: comp.sys.next.sysadmin
  2. Path: sparky!uunet!oceania!john
  3. From: john@oceania.com (John Robison)
  4. Subject: Re: Spaces in filenames
  5. Message-ID: <Bsznzs.1xF@oceania.com>
  6. Sender: john@oceania.com (John Robison)
  7. Reply-To: john@oceania.com
  8. Organization: Oceania Health Care Systems
  9. References: <1992Aug12.144727.17189@newstand.syr.edu>
  10. Distribution: usa
  11. Date: Fri, 14 Aug 1992 19:40:39 GMT
  12. Lines: 40
  13.  
  14. Brendan T. McNichols writes
  15. > Hi all,
  16. > # ---  Empty the Recycler(s)   --- Changed by Brendan on August 10, 1992
  17. > # from an earlier version posted by Jim Kiraly to comp.sys.next.sysadmin 
  18. > #
  19. > # Search through entire filesystem looking for .NextTrash directories.
  20. > # Save the list in the variable trashlist. For every .NextTrash  
  21. directory 
  22. > # found in the previous command, find and delete all files that are more 
  23. > # than 1 day old.
  24. > trashlist=`find / -type d -name .NextTrash -prune -print`
  25. > for j in $trashlist 
  26. >   do
  27. >     echo 'Removing files more than 1 day old from recycler: '$j
  28. > #    find $j -ctime +1 -depth -exec rm -rf {};
  29. >   done
  30. > Unfortunatly, the script does not work if one of the paths in the  
  31. > trashlist variable has a space in it. 
  32. >
  33. After playing with this for a while, I got the following to work
  34. (Although I used a slightly different command)
  35.  
  36. Instead of referencing your file to trash as $j,
  37. try referencing it as "${j}". (Include quotes)
  38.  
  39. This works for direct commands like 
  40. /bin/rm "${j}"
  41.  
  42. You will have to test it for find.
  43.  
  44. Regards,
  45.  
  46. John
  47. -- 
  48. John Robison - john@oceania.com
  49. NeXTMail Gladly Accepted
  50. --> What I say has absolutely nothing to do with
  51. my employer. They don't even know I am posting. <--
  52.