]> mj.ucw.cz Git - eval.git/blob - bin/mo-get-users
Use /bin/bash instead of /bin/sh in bang lines.
[eval.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; }"