[Top][All Lists]

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

Re: ls

From: Eric Blake
Subject: Re: ls
Date: Wed, 05 Oct 2005 14:38:28 +0000

>    I think the point that was trying to be made is the following - if
>    the user does
>    $ cd /tmp
>    $ rm *
>    then they know exactly why files are being removed.  But if they do
> Not if * gets expanded to `-rf /home/ams'.

The coreutils FAQ documents that you should really consider
rm -- * (any time an argument can be generated that can look
like an option, but should not be one, then use -- to make sure
it is not an option).  Furthermore, the coreutils FAQ documents
that filename expansion can exceed command line length
limitations, misses ./.file, and doesn't work in the presence of
word splitting, so that for removing all files, you should really
be doing something else more robust that does the recursion
for you, rather than relying on filename globbing (rm -r, or use
an invocation of find, etc.).  But that is besides the point of the
original question, which was why eval `dircolors` is unsafe.

Eric Blake

reply via email to

[Prev in Thread] Current Thread [Next in Thread]