Originally posted by: unixgrl
We do something like this:
Our "build.accounts" file contains j1=TAG (which set of users)
This is quicky ksh. You could use same logic in perl etc.
<hr />
[ && echo "Cannot access account
list."
while IFS=: read j1 id uid groups home shell gecos
do
idexists=`lsuser $id 2> /dev/null`
if ; then
pgrp=`echo $groups | awk -F\, '{print $1}'`
&& shell=/usr/bin/$shell
mkuser id=$uid pgrp=$pgrp groups=$groups home=$home gecos=\"$gecos\"
shell=$shell $id
chuser account_locked=true $id
else
echo "User $id already exist."
fi
done < build.accounts