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

  1. From: kevinl@tisdec.tis.tandy.com
  2. Date: 20 Aug 92 07:35 CDT
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: How can I rm a file with a '&' ????
  5. Message-ID: <28300002@tisdec.tis.tandy.com>
  6. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!eff!news.oc.com!utacfd.uta.edu!rwsys!trsvax!trsvax!tisdec.tis.tandy.com!kevinl
  7. Nf-ID: #R:<S025H1G@obh.in-berlin.de>:-26:tisdec.tis.tandy.com:28300002:000:518
  8. Nf-From: tisdec.tis.tandy.com!kevinl    Aug 20 07:35:00 1992
  9. References: <S025H1G@obh.in-berlin.de>
  10. Lines: 15
  11.  
  12.  
  13.     You can try 'rm -i *', or you can try using a hex editor on your
  14. directory and changing the files name slightly, like replacing the '&'
  15. with an 'A', and then removing the file.
  16.     You could also try piping a directory listing through awk like
  17. this:
  18.  
  19.     ls -l | awk '{if(index($8, "&")) system("rm " $8)}'
  20.  
  21. where $8 is the eighth column in you're long listing of the directory.
  22. If the file name appears in another column, adjust the number accordingly.
  23. The first column is $1 ($0 is the whole line).
  24.  
  25. Hope this helps! 8-)
  26.  
  27.