where $1 - name to search
and $2 - name of the file (sample.txt in this case)
Problem arises for the name dev .The above code only displays reec while i need reeec dev kapl (for more than one line we need the new line to be removed ) . In other words
Hi Johnnson ,
That worked with a small modification .
Can you explain what happens in this command
---------- Post updated at 04:40 AM ---------- Previous update was at 03:30 AM ----------
Hi Johnson,
This doesnt work. This is my command
nawk -v str="dev" ' { RS = "||"; FS = "-" } $0 ~ str { print $2}' sample.txt gives me
reeeec
and removes the new line. Any help is much appreciated