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

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User