Saturday 2 August 2008

AWK Windows Examples

Okay, here's the first; a simple Hello world example.

awk "BEGIN { print \"Hello world!\" }"

The above program will print Hello world! on the screen.

Linux users should notice the use of double quotation marks at the beginning & end of the script. Also notice how the quotations in the braces have had to be 'cancelled-out' with backslashes.

If anyone wants to know why I've become interested in Awk, it was based on me reading this thread on the Ubuntu Forum.
Bookmark and Share

No comments: