Date: Sun, 2 Nov 1997 09:33:29 -0500 From: Malcolm Boff <Malcolm_Boff@compuserve.com> To: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Potential bug in 'grep' 'echo' Message-ID: <199711020933_MC2-2671-A3D5@compuserve.com>
index | next in thread | raw e-mail
Thank you to all who responded to my question and for pointing out the
differences between the action of 'echo' under the Bourne Shell.
I think that there is a problem of documentation in either 'man 1 sh' or
'man 1 echo' as the '-e' flag is undocumented. Having looked at the source
code for the 'echo' builtin in Bourne it would appear that the 2 acceptable
flags '-n' and '-e' are mutually exclusive such that :-
echo -n -e "COMMENTS:\n\n"
results in :-
"-e COMMENTS:\n\n"
which is not what one might have expected, however
echo -e "COMMENTS:\n\n\c"
does give what is expected.
I conclude therefore that the definition of 'echo' under Bourne is :-
echo [ -n | -e ] [string ... ]
All responses directly to my personnal mail address please as I am not a
member of this forum.
Malcolm G. Boff
Sylmex Ltd.
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711020933_MC2-2671-A3D5>
