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

Re: [PATCH] latest ash has broken 'echo' command



* Anthony Towns said:

> > > it. Seriously, -e and -n are expected features of echo on GNU/Linux
> > > systems, no matter what the Single Unix Spec might or might not say.
> > In any case we need some standardisation on "echo" behaviour.
> > - should echo understand options?
> > - should echo default to interpret escaped characters?
> > - what escape characters are there and what is their interpretation?
> 
> First, for general portability, you can't rely on echo doing anything
> at all sane with options (some support no options, some support some
> options, some even support long options: /bin/echo --help; and echo
> --help give markedly different results, eg) or escape codes (GNU echo
> (/bin/echo on Debian) always interprets escapes unless you specify -E,
> bash only does them if you specify -e, and so on).
You are talking about *using* the command, not *implementing* it. The
implementation should support all arguments allowed by the standard it
follows, perhaps adding the customary arguments which are commonly used
albeit outside of the standard. Then the decision whether to use them or not
belongs to the programmer.
 
> So we're not going to make shell scripts more portable by conforming to
> either way, really. echo is all over the place.
Exactly my point. Adding the features to the builtin won't hurt anybody.
 
marek

Attachment: pgpvSWhXBUgFl.pgp
Description: PGP signature


Reply to: