On Thursday 07 September 2006 10:44, Otto Moerbeek wrote:
>On Thu, 7 Sep 2006, AndrC)s wrote:
>> egrep shouldn't find anything, you are searching for the string ""
>> in "some text here", clearly, it isn't there.
>
>Nah, an empty search pattern should match any line, as defined by SU
>and the man page. The only problem is if the -x option takes
>precendence or not. SU does not say a word about that.
>
>If anybody has access to a Solaris machine, I like to know what the
>test does there.

Here you go. I left the login banner in case you also want the version:

Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
$ echo "some text here" | egrep -x "" ; echo $status

$ 

The default egrep that is run is GNU grep 2.5. There are some other 
greps on the system, but they don't like the "-x":

$ echo "some text here" | /bin/egrep -x "" ; echo $status
/bin/egrep: illegal option -- x
usage: egrep [ -bchilnsv ] [ -e exp ] [ -f file ] [ strings ] 
[ file ] ...

$ echo "some text here" | /bin/grep -x "" ; echo $status
/bin/grep: illegal option -- x
Usage: grep -hblcnsviw pattern file . . .

$ 

------------------------------------------------------------------------
Dan Ramaley                            Dial Center 118, Drake University
Network Programmer/Analyst             2407 Carpenter Ave
+1 515 271-4540                        Des Moines IA 50311 USA

Reply via email to