Hi folks,

I just learned by accident that

        var="-n"
        /bin/echo -- $var

actually prints

        -- -n

Shouldn't it be just

        -n
?

Other tools in coreutils use '--' to indicate "stop parsing for
command line flags", e.g. touch, ls and rm:

        % /bin/touch -- -l
        % /bin/ls -- -l
        -l
        % /bin/rm -- -l
        % /bin/rm -- -l
        /bin/rm: cannot remove '-l': No such file or directory

Some common style would be nice here.


Regards
Harri

Reply via email to