Date: Fri, 31 Oct 1997 12:50:47 +0100 (MEZ) From: Robert Eckardt <roberte@mep.ruhr-uni-bochum.de> To: Malcolm_Boff@compuserve.com (Malcolm Boff) Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Potential bug in 'grep' Message-ID: <199710311150.MAA26262@beta.mep.ruhr-uni-bochum.de> In-Reply-To: <199710310449_MC2-2642-E24F@compuserve.com> from Malcolm Boff at "Oct 31, 97 04:49:16 am"
next in thread | previous in thread | raw e-mail | index | archive | help
> I have been checking out a pre-release set of software (GNU) and which
> uses a function in a shell script to determine whether or not the 'echo'
> command
> supports the '-e' flag (on FreeBSD it doesn't).
It doesn't ?
12:45 beta: /home/roberte 0% tcsh
12:45 beta: /home/roberte 0% (echo -e) | sed s/-e/xe/ | grep xe; echo $?
xe
0
12:46 beta: /home/roberte 0% echo -e
-e
12:47 beta: /home/roberte 0% sh
$ (echo -e) | sed s/-e/xe/ | grep xe; echo $?
1
$ echo -e
$
> To cut a long story short try the following :-
>
> (echo -e) | sed s/-e/xe/ | grep xe; echo $?
>
> here sed returns 'xe' and therefore should satisfy a match with 'grep' and
> should return '0' but it returns a '1' (no match ?).
>
> I think this is a 'bug' anyone agree ??
No. :-)
Robert
--
Dr. Robert Eckardt (
Ruhr-Universitaet Bochum, Inst.f.Theor.Physik, NB6/169 )
Universitaetsstrasse 150, D-44780 Bochum, Germany ----X---8----
Telefon: +49 234 700-3709, Telefax: +49 234 7094-574 8
E-Mail: RobertE@MEP.Ruhr-Uni-Bochum.de --------8----
URL: http://WWW.MEP.Ruhr-Uni-Bochum.de/~roberte
>>> A magician never reveals his secret: the unbelievable trick becomes <<<
>>> simple and obvious once it is explained. <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710311150.MAA26262>
