back toc next

Example 1

Slicing the input

bash$ ls -lg | awk '{ print $3, ":", $7 }'

Specifying the field separator

BEGIN { FS=":"; OFS=""; }
{ print $1, "'s name is: ", $5 }
called as
awk -f programfile /etc/passwd