411 REFERENCE · Wikibooks
Fedora And Red Hat System Administration/Awk Scripting
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Awk - A Data Driven Programming Language
Under Construction
Using Awk at the Command Line
Under Construction
Awk Scripts
Parsing User Information from passwd data
/usr/local/bin/bash-users.awk
#!/bin/awk -f
BEGIN {
FS = ":"
USER_COUNT = 0
}
/:\/bin\/bash$/ {
++USER_COUNT
print $1
}
END {
print USER_COUNT " bash users."
}
Usage:
[user@station user]$ getent passwd | bin/bash-users.awk
root
jkupferer
mesa
user
4 bash users.