Subject: Re: which echo.c would you choose?
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: current-users
Date: 11/30/1999 14:43:39
In article <Pine.NEB.4.10.9911300304260.6081-100000@handy.localnet>,
Frederick Bruckman <fb@enteract.com> wrote:
>
>The Single Unix Spec (which, as you may already know, is available
>online once you register: <http://www.unix-systems.org/online.html>),
>says "echo" shouldn't support _any_ options, including '--'. '--'
>should be recognized as a string operand, and '\c' is used to suppress
>the newline.
>

Since I did a lot of research on that before (to make tcsh work properly
on all OS's):

There are 2 flavors of echo:

BSD:	uses -n to suppress new lines, does not parse \ooo or \{a,e,t,n...}
SYSV:	uses \c to suppress new lines, parses ....

So if you recognize \c you *must* parse the \ escaped characters.
And if you recognize -n you *should* not parse the \ escaped characters.

At least if you don't want to surprise programs that expect the standard
behavior.

christos