Friday, June 18, 2010

awk------ a jewel...

Hi,
Its been a long time friends, since i last posted.
So what's better to reboot the posting spree than Linux.

awk is the focus today.
This post is not supposed to be an extended tutorial, but just a reference for novices and first timers.

awk is not just a simple command, its an interpreter, well atleast sort of.
you can write awk scripts, and rule the world :)

consider a condition in which you want to print the second column of every line of the input, which can be a file or even the output of some command piped through.

ls -l | awk '{print $2}'

this command does it all, takes the input from ls command and prints the 2nd column.

and its just not that you can even use if/for/while etc.

So, jump into the depths of awk.
More is coming.

No comments:

Post a Comment