Linux Today: Linux News On Internet Time.

Exercise #3:Using awk with Print and Printf

Feb 16, 2011, 10:03 (0 Talkback[s])

"The 10 Days of awk

"Our "10 days of awk" tutorial series is in full swing. This awk short-course includes tutorials, videos and exercises which are rolled out each day in an effort to help admins use awk more confidently.

* Exercise 1: Learning awk Basics
* An awk Example - Checking Processes for Memory Use
* Exercise 2: Learning awk with Operators
* Exercise 3: Using awk with Print and Printf
* Exercise 4: Starting with awk Scripts
* Download The awk One Liners PDF

"Exercise #3:Using awk with Print and Printf


"This is the action part of the awk command and it is enclosed in curly braces. This command by itself prints the input line but with one argument it prints the argument. If print has a number of arguments it prints all of the arguments separated by a space. You can use print to print multiple fields, represented by $num, and place those on a new line with " "."

Complete Story

Related Stories: