[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to escape this for the bash shell...



On Wed, Aug 04, 1999 at 03:08:55PM -0500, Michael Merten wrote:
> On Wed, Aug 04, 1999 at 03:08:20PM +0300, Alex Shnitman wrote:
> > On Wed, Aug 04, 1999 at 01:22:17AM -0600, Nate Duehr wrote:
> > 
> > > I have a file named :
> > > 
> > > ?????[4~?[4~?[4~?[4~?[4~?[4~?[4~?[4~?[4~?[4~
> > > 
> > > ... in my home directory. 
> > > 
> > > I am wondering how to escape this properly for rm to work on it in
> > > bash.
> > 
> > Most people told you to rm ./file or rm 'file' but that won't work of
> > course since you can't input the filename from the keyboard at
> > all. (The name as you typed it looks like it consists of escape
> > sequences, not something you can easily type on the keyboard.) So it's
> > a better idea to use the shell's wildcard expansion to do the work for
> > you. You can type rm -i * and then answer n for every file except for
> > this one.
> 
> It does look like escape sequences, but what key would produce ?[4~
> ... the closest I can find is PgDn which produces ^[[4~.  Is there
> a table/chart/listing of these somewhere for a linux term?
> 
the ? means unprintable character, and is probably really a ^[ (aka \e) (but
the shell cant print it). you cant know what the first chars are though. the
rm -i thing is the easiest (well here you could also use rm *[4~ since this is
not likely to match another name). when there are too many files you can also
use ls -i, then find. i guess this must be explained in every unix faq.

-lex

Attachment: pgpE4iM8aKwqi.pgp
Description: PGP signature


Reply to: