Increment the elements of an array by 1 (1 thru 1000) Increment the elements of an array by 1 (1 thru 1000) shell shell

Increment the elements of an array by 1 (1 thru 1000)


Try the seq command

cmd=( $(seq 1 1000) )


If you are running bash you may take advantage of its features.

Try:

cmd=({1..1000})


You can say:

cmd=( $(seq 1000) )

in order to create the array.