Need help with array in C shell

Hi all,
I'm newbie in shell. I'm trying to create files with user name select from database on title with .csh file. So my solution is select name from database into an array, and then foreach name I create a file with that name on title. Like this:

set Name[] = `sqlplus -s ${MYSQL}`  <<EOF
    WHENEVER SQLERROR EXIT SQL.SQLCODE
      SELECT NAME FROM TABLE;
    EXIT;
EOF

foreach name (${Name[*]})
    touch ${MYDIR}/${name}.xxx
�

Anyone can solve this?

---------- Post updated at 04:50 PM ---------- Previous update was at 04:17 PM ----------

problem solved!
Dear mod,
Help me to close this. Thanks!

I won't close the thread as you might get a better answer. Although we wouldn't know that unless you say how your problem was solved.

Leejung, I believe you could share the solution of this issue :slight_smile:

well, I just fix like that

set Name = `sqlplus -s ${MYSQL}`  <<EOF
    WHENEVER SQLERROR EXIT SQL.SQLCODE
    SET HEADING OFF
    SET COLSEP ' '
      SELECT NAME FROM TABLE;
    EXIT;
EOF

then I will have an array look like:

Name = (nameA nameB nameC)

Each items got 1 space separates them. Then I use this code below to read all name and create files

foreach name (${Name[*]})
    touch ${MYDIR}/${name}.xxx
end