Dangerous use of 'rm'

Aled Morris aledm at qix.co.uk
Tue Jul 11 11:01:41 BST 2006


Stephen Allen wrote:

> "ls <mega_long_path> -al"  does not work.
>
> Is it a FreeBSD thing or a general configuration thing?



I think it is a heritage thing.

Traditional Unix commands are implemented like this:

main()
{
    while (getopt)
        process flag

    if (any remaining arguments) {
        foreach (remaining arguments)
            take input from file named "argument"
    } else {
       take input from stdin
     }
}

if that makes sense.  "keep it simple" is the idea.

In english, flags are read first but as soon as the first non-flag is 
encountered, the rest of the command line is treated as input files (or 
whatever)

I would strongly advise against changing this behaviour.

Aled




More information about the Ukfreebsd mailing list