exec a build command (adduser) in a script

Hi,

With a awk script i create a "adduser line"

$ cat /tmp/tmp.ldif | awk -f ldif2adduser.awk
adduser --uid 1002 --gid 1000 --gecos "ROUSSIN Guy" --home /homeL/guy --shell /bin/bash --disabled-password guy

If i cut and paste this line, all is fine. But in a shell script i get errors :

# cat t.sh
#!/bin/bash
# ADDUSER=`cat /tmp/tmp.ldif | awk -f ldif2adduser.awk`
ADDUSER="adduser --uid 1002 --gid 1000 --gecos \"ROUSSIN Guy\" --home /homeL/guy --shell /bin/bash --disabled-password guy"
echo ${ADDUSER}
${ADDUSER}

# ./t.sh
adduser --uid 1002 --gid 1000 --gecos "ROUSSIN Guy" --home /homeL/guy --shell /bin/bash --disabled-password guy
Warning: The home dir /homeL/guy you specified already exists.
adduser: The user `Guy"' does not exist.

The problem is when there is spaces in --gecos param.

I tried some workaround but without success.

Thank you.

Guy

i found 2 ways,:

this i don't like so much

PART1="sudo adduser --uid 1010 --gid 1000 --home /homeL/guy --shell /bin/bash --gecos "
GECOS="ROUSSIN Guy"
PART3="--disabled-password guy"
${PART1} "$GECOS" $PART3
ADDUSER="sudo adduser --uid 1011 --gid 1000 --home /homeL/guy --shell /bin/bash --gecos \"ROUSSIN Guy\" --disabled-password guy2"
echo $ADDUSER >file_tmp.$$
sh file_tmp.$$
rm file_tmp.$$

Thank you chipcmc. I use your second way very fine.

Thank you again.

Guyr