On 08/18/2014 07:34 PM, Peng Yu wrote:
> Hi,
> 
> The following shows that echo does not following the "getopt"
> convection. Is it better to make all bash internal command following
> the getopt convention?

No, that would break backward compatibility.

> 
> ~$ echo -n
> ~$ echo -n -n
> ~$ echo -n -- -n # I think that the output should just be "-n" not "-- -n".
> -- -n~$

For that matter, POSIX requires this to output "-n -- -n", since POSIX
does not allow for echo to interpret -n.  In fact, if you do 'shopt -s
xpg_echo', then you get full POSIX behavior.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to