Hi,
Shell script: I would need help on How to extract 3rd line 4th column of a file with single liner
Thanks in advance.
Try this!!
cat abc|head -4|tail -2
nawk 'if (NR==3){print $4}' input_file
or
nawk 'NR==3{print $4}' input_file
This will give you the fourth field in the 3rd line
head -3 file | tail -1 | awk ' { print $4 } '
should work fine
Alternative way
sed -n '3 p' filename |awk '{ print $4 }'