Get an element of a list inside a command in SHELL script -


i run java application specified parameter settings, , of parameters come iteration of list. proper way? many thanks!

outs="/home/user/this.vcf /home/user/that.vcf  /home/user/simulation/control.vcf" arr=($outs)  ending=3  ((i=1;i<=ending;i++)); java -xmx32g -jar /home/user/something.jar \ -o $arr[i] \ done 

you missing brackets. additionally, note shell arrays zero-based, for statement needs amended:

for ((i=0;i<ending;i++)); java -xmx32g -jar /home/user/something.jar \ -o ${arr[i]} \ done 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -