Awk parameter extraction
Today I learned that if you want to extract the nth column with awk you simply run this command
awk -v x=n "{print $x}"
Update Johan Jensen made me aware that you can do this even simpler
awk "{print $2}"
Today I learned that if you want to extract the nth column with awk you simply run this command
awk -v x=n "{print $x}"
Update Johan Jensen made me aware that you can do this even simpler
awk "{print $2}"