command line - Using multiple variables in a for loop - Ask Ubuntu
i want use 2 variables in for
loop (this example, i'm not going execute seq
operations)
for j `seq 1 2` 'www.google.com www.yahoo.com';do echo $i $j;done
expected output
1 www.google.com
2 www.yahoo.com
if i number incremented each string, try for loop , increment i each iteration.
for example:
i=1; j in 'www.google.com' 'www.yahoo.com'; echo "$((i++)) $j"; done
Comments
Post a Comment