bash - awk giving different behavior on different systems -
i using awk grep paragraph containing specific keyword until record seperator in case space.
awk -vrs= /\<keyword2\>/ file.txt
and file.txt contains this
this first keyword1 occurance , line in first paragraph second keyword2 occurance , line in second paragraph
now output of awk
command should
this second keyword2 occurance , line in second paragraph
but works on 1 of system. doesn't work on others. please help
error found
installed nawk
on ubuntu 14.04 , not work.
works fine gawk
you can try sed
:
sed -n '/\<keyword2\>/,/^$/p' file.txt
Comments
Post a Comment