Hi,
i am using fgrep command with following syntax
fgrep -v -f pattern_file_name file
file contains few line and have the pattern which i am giving in pattern file.
My Problem is :
its is not giving any output.
while i am using fgrep -f pattern_file_name file
it is showing all lines of file.
this was the case of Cshell, if i run these command in tclsh
then (fgrep -v -f pattern_file_name file) command giving exception like -child process exited abnormally.
please provide me a solution of this problem.
Thanks
yazu
2
I believe the only cause is wrong patterns in your "pattern_file_name". But I could be wrong of course.
panyam
3
I tried in CSH and the same worked for me OK.
cat rem
aa bb
gg
dd ff
cat rem1
ss ddd aa bb ff gg
dd ff ff ff fff
dsds
dsd
agdsgs
TESTBOX> fgrep -f rem rem1
ss ddd aa bb ff gg
dd ff ff ff fff
TESTBOX> fgrep -v -f rem rem1
dsds
dsd
agdsgs
post the sample i/p and o/p from your system.
Thanks Panyam
I used same file which you have shown in ur thread but still ...
cat file ----
ss ddd aa bb ff gg
dd ff ff ff fff
dsds
dsd
agdsgs
cat filter1
aa bb
gg
dd ff
Output for the command ---fgrep -f filter1 file
it is giving complete file
ss ddd aa bb ff gg
dd ff ff ff fff
dsds
dsd
agdsgs
output for the command ---fgrep -v -f filter1 file
it is not printing anything
so what may be the problem with me ?
Thanks
panyam
5
Looks odd!!..
Is it a simple "grep" working?
try with grep -f option and see.