From owner-freebsd-questions Tue Jun 27 6:14:27 2000 Delivered-To: freebsd-questions@freebsd.org Received: from enterweb.enterit.com (enterweb.enterit.com [209.45.199.22]) by hub.freebsd.org (Postfix) with ESMTP id 14CFF37BBCD for ; Tue, 27 Jun 2000 06:14:22 -0700 (PDT) (envelope-from jconner@enterit.com) Received: from KWAN [209.45.199.38] by enterweb.enterit.com with ESMTP (SMTPD32-5.04) id A8621C080106; Tue, 27 Jun 2000 09:13:06 EST Message-Id: <4.2.0.58.20000627091845.00a84ce8@mail.enterit.com> X-Sender: jconner@mail.enterit.com X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Tue, 27 Jun 2000 09:26:01 -0400 To: Mark Ovens , freebsd-questions@freebsd.org From: Jim C Subject: Re: Question about echo(1) In-Reply-To: <20000626222417.J232@parish> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 22.24 26.06.00 +0100, Mark Ovens wrote: >I found in a script ``echo -e .....''. The echo(1) manpage doesn't >list this as an option. builtin(1) lists echo as both external and >internal to both csh(1) and sh(1) but the sh(1) manpage doesn't >mention echo. > >Under csh(1) ``echo -e'' prints ``-e'', but under sh(1): > > parish# sh > # echo > > # echo -e > > # echo foobar > foobar > # echo -e foobar > foobar > # > >So, what does ``-e'' do under sh(1)? It only manipulates how echo interprets escpae sequences within the bourne [again] shells. In Korn, this argument is entirely not needed. ie: #!/bin/sh echo -e "enter a number: \n >>>" echo "Enter a number: \n" EOF $ ./script.sh >enter a number >>> >enter a number: \n --------- Where as for korn #!/bin/ksh echo "Enter a number: \n >>>" EOF $ ./script.ksh >enter a number >>> Notice in the first example when I didn't use the -e arg that the line -- echo "enter a number: \n" spit out "enter a number: \n". The -e simply means escape :) - Jim >-- > If I buy a copy of WinDelete, and it doesn't delete Windows, > am I entitled to my money back? >________________________________________________________________ > FreeBSD - The Power To Serve http://www.freebsd.org > My Webpage http://ukug.uk.freebsd.org/~mark/ >mailto:mark@ukug.uk.freebsd.org http://www.radan.com > > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message