]> mj.ucw.cz Git - moe.git/blob - bin/mo-get-users
e8a3d2cef66065ed7b08464eb5e76cff2fc023c1
[moe.git] / bin / mo-get-users
1 #!/bin/bash
2
3 if [ "$1" = --help ] ; then
4         echo "Usage: mo-get-users [--full]"
5 fi
6 [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
7 set -e
8 . config
9
10 if [ "$1" = --full ] ; then
11         FORM='$1,"\t",$5'
12 else
13         FORM='$1'
14 fi
15 awk -F: </etc/passwd "{ gsub(\",.*\",\"\",\$5); if (\$3 >= $CT_UID_MIN && \$3 <= $CT_UID_MAX) print $FORM; }"