ref: a351bcdccdf5a4273bc8dc3360a48fbb8b8aa9ea
dir: /src/list2usr/
#!/bin/rc rfork e users=/tmp/list2usr.$pid cat /adm/users > $users fn sigint { rm $users } ; fn sighup { rm -f $users } fn listusers { awk '-F|' ' /^#/ { next } /^$/ { next } $3 ~ /Operating Systems/ && $4 ~ /B/ { print $2 } ' $* } fn uname1 { echo $* | sed 's/(.)[^ ]+[ ]+(.*)/\1\2/' } fn uname2 { echo $* | sed 's/([^ ]+)[ ]+(.).*/\1\2/' } fn add { if (grep -s '^[^:]+:'^$1^':' $users) status=exist if not { echo $1:$1:$1: >>$users echo adduser $* status='' } } listusers $* | tr A-Z a-z | tr '[áéíóúñ]' '[aeioun]' | while(name=`{read}){ add `{uname1 $name} $name || add `{uname2 $name} $name || echo '#' cannot determine user name for $name } rm -f $users exit ''