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?
RudiC
October 7, 2016, 2:22pm
2
http://www.unix.com/man-page/opensolaris/1/grep/ says:
SYNOPSIS
/usr/bin/grep [-bchilnsvw] limited-regular-expression
[filename]...
/usr/xpg4/bin/grep [-E | -F] [-c | -l | -q] [-bhinsvwx] -e pattern_list...
[-f pattern_file]... [file]...
/usr/xpg4/bin/grep [-E | -F] [-c | -l | -q] [-bhinsvwx]
[-e pattern_list]... -f pattern_file... [file]...
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 ...
blastit.fr:
On any system:
grep -F
stands for fgrep
which is a grep
without regexp
as
grep -F
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.
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.
drl
October 8, 2016, 10:39am
7
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)
Best wishes ... cheers, drl