home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!murphy!jpradley!jpr
- From: jpr@jpradley.jpr.com (Jean-Pierre Radley)
- Subject: Re: file removal problem solved.
- Organization: Unix in NYC
- Date: Mon, 31 Aug 1992 00:45:04 GMT
- Message-ID: <1992Aug31.004504.24012@jpradley.jpr.com>
- References: <BtMJuK.KEH@acsu.buffalo.edu>
- Lines: 47
-
- In article <BtMJuK.KEH@acsu.buffalo.edu> vidya-v@acsu.buffalo.edu (vidyaranya) writes:
- >
- >Thanks to:
- >jimr@col.hp.com
- >silvert@cs.dal.ca
- >ant@palm.cray.com
- >msb@sq.com
- >
- >for responding.
- >
- >The solution I finally used came from our system administrator.
- >I had already tried the 'rm -i' and rm A* options and posted
- >when they failed.
- >
- >The solution I used needed a simple C program and an Octal
- >dump of the filename to specify in the C program.
- >Here it is:
- >
- >#include <stdio.h>
- >
- >main()
- >{
- >
- > char *string = "\101\356\377\114\116\271\002\370\116\271\002\240\055\100\377\214\055\012";
- > char buf[1024];
- >
- > sprintf(buf, "rm %s", string);
- > system(buf);
- > exit(0);
- >}
- >
- >This seems like a sure shot way of removing the file when all attempts
- >to fool the shell fail.
-
- A C program to remove a file with funny characters? Suppose one of the
- characters had been a ^H, you really wouldn't know what you were looking at
- on your screen.
-
- Get the inode of the file, call it N, with
- l -i /the/directory/with/the/problem
- Then use
- find /the/directory/with/the/problem -inum N -ok rm {} \;
-
- Do read the FAQ postings! Certainly see that the system administrator
- reads them before applying for his/her/its next job.
- --
- Jean-Pierre Radley Unix in NYC jpr@jpr.com jpradley!jpr CIS: 72160,1341
-