Example 1
Slicing the input
bash$ ls -lg | awk '{ print $3, ":", $7 }'
- Who tells awk which character to take as field separator?
- And why are there spaces between the fields in the output string?
Specifying the field separator
BEGIN { FS=":"; OFS=""; }
{ print $1, "'s name is: ", $5 }
called as
awk -f programfile /etc/passwd