About the \r bug in Ascii Pfiles

From: Welcor (welcor@dune.net)
Date: 08/17/01


Hello all.

I'm wondering if there's an easy (ie. non-manual) way of removing files
containing special chars. I've had the bug with the DOS pfiles, causing
a lot of files to be created with special chars in the filename:

lib/pfiles/w/welcor\r
lib/plrobjs/U-Z/welcor\r.new

(btw. those are listed with 'ls' as:

lib/pfiles/w/welcor?
lib/plrobjs/U-Z/welcor?.new)

Now, I can go through all the dirs and manually delete the files, like

rm lib/pfiles/w/welcor?

This works, but since the error has struck quite a lot of people throughout
the pfiles / objfiles, it's quite a task to go through them all by hand.

What I'd like is a way to delete these files in one or two commands, perhaps
through a script (be it bash or perl, I don't really mind).

I've tried a combination of the following, neither of them working:

ls *\r     -   lists all pfiles which end with an 'r'
ls *\\r    -   no such file '*\r'
ls *\r.new -   lists all rentfiles which end with an 'r'

I know that as soon as I've got the wildcards right, I can delete them
as easily as I'm listing them.

I've been through 'man bash' and looked at piping the results of an
ls through grep into rm - but I can't figure out how to enter a control
character (in this case ^M) in grep - or for that sake in a general
regular expression pattern.

I have access to (but not enough knowledge about) perl, and I'd REALLY
like to avoid writing a C program just to remove some files.

Any and all help is appreciated.

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST