because
# when you change password for the uid, it finds the first match in/etc/passwd
# which isn't necessarily the correct user
# = yes [! -Z "$ needinput"]; do
_UID = "$ (get_input" User ID ('UID') [defaults to next available]: ")"-v "^ $" $ pfile | awk-F : '{print $ 3}' | grep "^ $ {_UID} $">/dev/null 2> & 1 [$? -Eq 0]; then "- That UID is already in use; please choose another" [! -Z "$ (echo $ _UID | egrep [A-Za-z])"]; then "- UIDs are numerics only" needinput
# If we were given a UID, then syntax up the variable to pass to useradd [! -Z "$ _UID"]; then_ID = "-u $ {_UID}"
# Will we be recycling UIDs? ["$ recycleuids" = "yes"]; then_ID = "-u $ (awk-F: '{uid [$ 3] = 1} END {for (i = ENVIRON ["recycleUIDMIN"]; i in uid; i + +); print i} '$ pfile) "
#: Get the initial group for the user & ensure it exists: #
#
# We check/etc/group for both the text version and the group ID number = yes [! -Z "$ needinput"]; do = "$ (get_input" Initial group [users]: ")" _group "$ GID" [$? -Gt 0]; then "- Please choose another" needinput
# Syntax the variable ready for useradd [-z "$ GID"]; then = "-g users" = "-g $ {GID}"
#: Get additional groups for the user: #
# = yes [! -Z "$ needinput"]; do = "$ (get_input" Additional groups (comma separated) []: ")" = "$ (echo" $ AGID "| tr-d '' | tr, '') "; # fix up for parsing [! -Z "$ AGID"]; then_group "$ AGID"; # check all groups at once (treated as N # of params) [$? -Gt 0]; then "- Please re-enter the group (s)" needinput; # we found all groups specified = "-G $ (echo" $ AGID "| tr '',)" needinput; # we don't * have * to have additional groups
#: Get the new user's home dir: #
# = yes [! -Z "$ needinput"]; do = "$ (get_input" Home directory [$ {defhome}/$ {LOGIN}] ")" [-z "$ HME"]; then = " $ {defhome}/$ {LOGIN} "
# Warn the user if the home dir already exists [-d "$ HME"]; then "- Warning: '$ HME' already exists!" = "$ (get_input" Do you wish to change the home directory path? (Y/n) ")" ["$ (echo $ getyn | grep-i" n ")"]; thenneedinputneedinput = "-d $ {HME } "
#: Get the new user's shell: # = yes [! -Z "$ needinput"]; dogot_error = "$ (get_input" Shell [$ {defshell}] ")" [-z "$ SHL"]; then = "$ {defshell}"
# Warn the user if the shell doesn't exist in/etc/shells or as a file [-z "$ (grep" ^ $ {SHL} $ "$ sfile)" ;]; then "- Warning: $ {SHL} is not in $ {sfile} (potential problem using FTP)" _error = yes [! -F "$ SHL"]; then "- Warning: $ {SHL} does not exist as a file" _error = yes ...