== Reference ==
* http://stone.backrush.com/sunfaq/ljs006.html
== Using awk ==
# Running awk
* awk 'instructions' files
* awk -f script files
# examples
* awk '{ print $1 }' list
* awk '/MA/' list
* awk '/MA/ { print $1 }' list
* awk -F, '/ma/ { print $1 }' list
* awk -F, '/ma/ { print $1; print $2; print $3 }' list
* example
awk -F, '{
print $4 ", " $0
}' $* |
sort |
awk -F, '
$1 == LastState {
print "\t" $2
}
$1 !== LastState {
LastState = $1
print $1
print "\t" $2
}'
* result
California
Amy Wilde
Massachusetts
Eric Adams
John Daggett