MLUG: Re: [MLUG] a file named minus
Re: [MLUG] a file named minus
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
at least with rm you can use '--' to terminate the argument list and then '-' will be interpreted as a filename instead of an argument. Haven't tried it with cat or other utilities.

----- Original Message ----
From: Mike Miller <EMAIL:PROTECTED>
To: MLUG membership <EMAIL:PROTECTED>
Sent: Wednesday, January 3, 2007 11:53:42 PM
Subject: [MLUG] a file named minus

I managed somehow to create a file named '-' (without the quotes). 
Anyway, this was not easy to remove from the command line and it was even 
harder to see the contents of the file.  For example, this fails:

cat '-'

On Solaris, tcsh shell, this failed:

rm '-'

But that same command worked on a Linux box under tcsh.

I didn't think it was that hard to deal with a file with that name.  In 
the end I opened a GUI file manager on Solaris and used that to delete it. 
That was pretty crazy.

Mike

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members




_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members