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

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -