home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / shell / 3703 < prev    next >
Encoding:
Text File  |  1992-08-30  |  1.6 KB  |  58 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!murphy!jpradley!jpr
  3. From: jpr@jpradley.jpr.com (Jean-Pierre Radley)
  4. Subject: Re: file removal problem solved.
  5. Organization: Unix in NYC
  6. Date: Mon, 31 Aug 1992 00:45:04 GMT
  7. Message-ID: <1992Aug31.004504.24012@jpradley.jpr.com>
  8. References: <BtMJuK.KEH@acsu.buffalo.edu>
  9. Lines: 47
  10.  
  11. In article <BtMJuK.KEH@acsu.buffalo.edu> vidya-v@acsu.buffalo.edu (vidyaranya) writes:
  12. >
  13. >Thanks to:
  14. >jimr@col.hp.com 
  15. >silvert@cs.dal.ca
  16. >ant@palm.cray.com
  17. >msb@sq.com
  18. >
  19. >for responding.
  20. >
  21. >The solution I finally used came from our system administrator.
  22. >I had already tried the 'rm -i' and rm A* options and posted
  23. >when they failed.
  24. >
  25. >The solution I used needed a simple C program and an Octal
  26. >dump of the filename to specify in the C program.
  27. >Here it is:
  28. >
  29. >#include <stdio.h>
  30. >
  31. >main()
  32. >{
  33. >
  34. >        char *string = "\101\356\377\114\116\271\002\370\116\271\002\240\055\100\377\214\055\012";
  35. >        char buf[1024];
  36. >
  37. >        sprintf(buf, "rm %s", string);
  38. >        system(buf);
  39. >        exit(0);
  40. >}
  41. >
  42. >This seems like a sure shot way of removing the file when all attempts
  43. >to fool the shell fail.
  44.  
  45. A C program to remove a file with funny characters? Suppose one of the
  46. characters had been a ^H, you really wouldn't know what you were looking at
  47. on your screen.
  48.  
  49. Get the inode of the file, call it N, with
  50.     l -i /the/directory/with/the/problem
  51. Then use 
  52.     find /the/directory/with/the/problem -inum N -ok rm {} \;
  53.  
  54. Do read the FAQ postings! Certainly see that the system administrator
  55. reads them before applying for his/her/its next job.
  56. -- 
  57. Jean-Pierre Radley   Unix in NYC   jpr@jpr.com   jpradley!jpr   CIS: 72160,1341
  58.