awk 'BEGIN { print "Hello world!" }'
Showing posts with label gawk. Show all posts
Showing posts with label gawk. Show all posts
Sunday, 3 August 2008
Linux Awk Example
Here is a 'Hello World!' example written using Awk in Linux. You can compare it to this example for Windows.
Useful AWK Links
Here are some useful links which will help you in learning AWK.
Saturday, 2 August 2008
AWK Windows Examples
Okay, here's the first; a simple Hello world example.
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.
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.
AWK, GAWK, MAWK etc...
I'd been hearing about 'awk' for a longtime on the Ubuntu forum. It's a simple command-line tool that you can use for searching through text files. I've just downloaded the Windows version which can be found here.
The biggest difference between the Linux version & the Windows version so far has been in how you enter quotation marks for the tasks.
I'll try & post some usage examples later on.
The biggest difference between the Linux version & the Windows version so far has been in how you enter quotation marks for the tasks.
Single for Linux '
Double for Windows "
I'll try & post some usage examples later on.
Subscribe to:
Posts (Atom)