A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.
useradd script fail
Im getting a tr: [:upper:] and/or [:lower:] misalignment and I'm not sure why. Also on the useradd line it's erroring saying group -G doesnt exist when -G is an addition group option not a group......Help
# Name: script1
# Version: 1.0
# Purpose: To add users to system and groups
# Created: 10-29-2015
# Creator: Matt Winnekins
echo "Enter users FIRST name"
echo "Enter LAST name"
echo "Enter the users INITIAL group"
echo "Enter the users ADDITIONAL groups"
# Now trim the output
DNFNAME=`echo $FNAME | tr [:upper:] [:lower:]`
DNLNAME=`echo $LNAME | tr [:upper:] [:lower:]`
LOWIGROUP=`echo $IGROUP | tr [:upper:[ [:lower:]`
LOWAGROUP=`echo $AGROUP | tr [:upper:] [:lower:]`
UFNAME=`echo $FNAME | tr [:lower:] [:upper:] | cut -c 1`
DFNAME=`echo $DNFNAME | cut -c 2-`
ULNAME=`echo $LNAME | tr [:lower:] [:upper:] | cut -c 1`
DLNAME=`echo $DNLNAME | cut -c 2-`
useradd -c "$CFLNAME, $CFFNAME" -g $LOWIGROUP -G $LOWAGROUP $LOGIN
echo 123456 | passwd --stdin $LOGIN
# repeat script below
echo "Press (y) to add another user"
CLEANYORN=`echo $YORN | cut -c 1 | tr [:upper:] [:lower:]`
if [ "CLEANYORN" = "y" ] ; then