Grep command Fails on SunOS Sparc

Hi,

This command works

ggrep -v -F -x -f app1.txt app2.txt

But, I don't have ggrep on SunOS Sparc so I tried using grep instead but it errors out

grep: illegal option -- F
bash-2.03$ uname -a
SunOS mymac 5.8 Generic_Virtual sun4v sparc sun4v

Can you help me with a grep command that works on SunOS Sparc?

http://www.unix.com/man-page/opensolaris/1/grep/ says:

Hi,

can you share sample input for app1.txt , app2.txt and desired output ?

On any system:
grep -F stands for fgrep
which is a grep without regexp
as
grep -E stands for egrep

so you shoult try

fgrep -v -x -l -f file1 ...

Also considere that the flags are position dependent : the uppercase flags -F , -E ...would be in 1st position, so you should try :

grep -F -v -x  -f file1 ...

I will assume that the " grep -F stands for egrep " was a typo and you meant to say " grep -F stands for fgrep ". But, the standards are perfectly clear that there is absolutely no difference in the behavior of any of the following:

grep -F -v -x ...
grep -v -F -x ...
grep -x -v -F ...
grep -xvF ...
grep -Fvx ...

as long as the options listed do not include mutually exclusive options (such as E and F ). If you specify more than one of the mutually exclusive E and F options or more than one of the mutually exclusive c , l , and q options in any order; the results are unspecified.

@Don :
typo corrected
The behaviour of all different grep versions on different unix flavours could be odd. I faced it recently on ibm aix.

Hi.

On a system:

aix 7.1.0.0
grep - ( /usr/bin/grep, Oct 01 2012 )

I see:

$ cat t1
1
2
3

and:

$ grep -F -v 2 t1
1
3

As well as:

$ grep -v -F 2 t1
1
3

So it seems OK for that near-trivial test for that system.

However, we often said that AIX was an acronym for AIn't UniX on the 3090 systems we used (way back then) :slight_smile:

Best wishes ... cheers, drl