Shell script use two variable in for loop

I want to create a shell script to add a user and modify its comment field mentioned in a file.

File value:-

 username       comment field value

xyz123            xyztesting
abc123            abctesting
def123            deftesting
  1. i am using below loop to create user corresponding to comment field mentioned in file:-
for i in `cat y | awk '{ print $2 }'`, j in `cat y | awk '{print $1}'`; do echo "useradd $j  -c "\""$i"\""";done 
  1. Please suggest or modify this loop to get below desired output
useradd  xyz123  -c  "xyztesting"
useradd  abc123  -c   "abctesting"
 useradd  def123   -c   "deftesting"

The 'while read' loop is better in almost every way. It avoids the waste of using cat, and doesn't have the unfortunate side-effects of working behind a pipe (variable changes not preserved in most shells).

while read USERNAME COMMENT
do
        echo "USERNAME=$USERNAME, comment=$COMMENT"
done < inputfile

You can change the delimiter by changing the IFS variable, i.e. IFS=":" read var1 var2 var3

Welcome to the forum.

Is that homework / classwork? If yes, we have an extra forum for these - please post there.

Your for loop - although syntactically correct - has a logical error in it; it works on this list: comment xyztesting abctesting deftesting, j in username xyz123 abc123 def123 running i through each element of it.
Using awk anyhow in your script, why not have it do ALL the work for you, in one go?