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

Re: ash - options to `echo' command



On Wed, Oct 20, 1999 at 09:27:48PM -0500, Gregory T. Norris wrote:
> I was just curious about why ash's builtin `echo' command no longer
> accepts any options?  It causes interesting (though generally harmless)
> output in a variety of places, because I use ash as /bin/sh.  For
> example:
> 
>      adric@glitch[~]$ grep -l "echo -n" /etc/init.d/* | wc -l
>           35
> 
> I haven't filed a bug report because changelog.Debian.gz shows that it
> was an intentional change... so I assume that it was done in order to
> conform with POSIX (or another such standard).  Is this correct?  If

The change was made in line with the SuS.  Note that it is not possible
to write echo statements portably across platforms because of legacy
shells that do support options.  That is why it is recommended to use
printf instead of echo.

> so, I guess I should start filing `bashism' bug-reports against scripts
> which start out `#! /bin/sh' and make use of `echo -n' or `echo -e'?

Yes, options are not supported under the SuS.
-- 
Debian GNU/Linux 2.1 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Reply to: