Remember our discussion on creating a file called -Rf in / and running
an rm * on /
Well DO Not DO it!
(This happened in Busket in REAL life not on the list)

As expected the shell expands * to all the file names and passes these
as 
parameters to rm which interprets -Rf as an option not a filename!!. 

I tried it on a test directory in /tmp for those of you wondering.

The shell will just run rm -Rf ./a ./b ./c etc. 

Of course if you do end up with a file called -Rf the way to remove it
is rm -- -Rf 
The -- option means "Options end Here, the rest are filenames".

If you were wondering how to create a file called -Rf its simple
touch also takes the -- option, as do a few other standard commands.

I remembered to test this out while reading a /. article on raid
and someone said that to avoid silly rm -Rf * accidents he
is in the habit of doing a touch -- -i in important directories.

What good is a raid if you cannot tell your * s form your -- s?

Philip


--
Philip Serracino Inglott  <[EMAIL PROTECTED]>
                     http://www.inkwina.net/
                                          --

Dungeons and Dragons is just a lot of Saxon Violence.

Reply via email to