From owner-freebsd-questions Sun Nov 2 06:34:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA22276 for questions-outgoing; Sun, 2 Nov 1997 06:34:24 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from dub-img-7.compuserve.com (dub-img-7.compuserve.com [149.174.206.137]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA22253 for ; Sun, 2 Nov 1997 06:34:21 -0800 (PST) (envelope-from Malcolm_Boff@compuserve.com) Received: (from mailgate@localhost) by dub-img-7.compuserve.com (8.8.6/8.8.6/2.8) id JAA21212 for freebsd-questions@freebsd.org; Sun, 2 Nov 1997 09:33:50 -0500 (EST) Date: Sun, 2 Nov 1997 09:33:29 -0500 From: Malcolm Boff Subject: Re: Potential bug in 'grep' 'echo' To: freebsd-questions Message-ID: <199711020933_MC2-2671-A3D5@compuserve.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.freebsd.org id GAA22259 Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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.