Removing garbage files

Ronald Pikkert ronald at atcmp.nl
Sun Jun 3 07:00:53 AEST 1990


>From article <156 at TWG.UUCP>, by bill at TWG.UUCP (Bill Irwin):
> Here  is  one that has got me beat, frustrated and down right  angry.   I
> have  some  files  in a directory that I can't remove.  

Your shell probably strips the high order bit which causes rm to be unable
to delete these files.
You can remove them using a c-program. I wrote a shell script that creates
a c-program that does the job:


-------------------  cut here   ------------------
echo "main() {"
ls -b | sed 's/\(\\\)\([^0]\)/\10\2/g
s/\\$/\\\\/
s/"/\\"/g
s/^/unlink(\"/
s/$/");/
' 
echo "}" 
-------------------  cut here   ------------------


Run this script in the directory and it will generate a program
dl.c Compile the program (cc dl.c -o dl). The run ./dl and there 
will be no need to reformat your anymore disk :-)


-
Ronald Pikkert                 E-mail: ronald at atcmp.nl
@ AT Computing b.v.            Tel:    080 - 566880
Toernooiveld
6525 ED  Nijmegen



More information about the Comp.unix.wizards mailing list