- has grep like functionality using /
- awk -F: '/:0/{print $1,$3}' /etc/passwd
- gets powerful when added to regular expressions -- next few slides
- printf means 'print, formatted'
- printf "%-8s", $1 means use 8 characters for the first field left justified, and it's a string (not a number)
- printf "%5i", $4 means allocate 5 characters for the fourth field, and it's an integer
- awk -F: '/:0/{printf "%-8s %3i
", $1, $3}' /etc/passwd
- sooo...what does the above do?
- awk can be on many lines, too
NEXT
PREVIOUS
Master Index