Has anyone experienced problems with shells failing on sol8 when the script passes space separated strings as an argument to a command? The script works fine on Sol2.6
e.g.
# get user description
while [ -z "$COMMENT" ]
do
read -r COMMENT?"Please enter a comment to identify this user > "
done
# if we entered "joe bloggs" as the info and then we do something like....
/usr/sbin/useradd -g other -d /export/home/$LOGIN -s /bin/ksh -c "$COMMENT" -m $LOGIN
The script fails because the comment was not wrapped in quotes but if when I'm prompted for the comment I place the comment inside quotes then it works ok.
I've tried various combinations on wrapping the comment inside the script but it fails on every occasion.
Anyone have a simple answer to this, i think the only thing i haven't tried is echo'ing the string on the command line....will that work?
ART
e.g.
# get user description
while [ -z "$COMMENT" ]
do
read -r COMMENT?"Please enter a comment to identify this user > "
done
# if we entered "joe bloggs" as the info and then we do something like....
/usr/sbin/useradd -g other -d /export/home/$LOGIN -s /bin/ksh -c "$COMMENT" -m $LOGIN
The script fails because the comment was not wrapped in quotes but if when I'm prompted for the comment I place the comment inside quotes then it works ok.
I've tried various combinations on wrapping the comment inside the script but it fails on every occasion.
Anyone have a simple answer to this, i think the only thing i haven't tried is echo'ing the string on the command line....will that work?
ART