I have a following line:for length in $(ls $OUT_SAMPLE)do $CODES/transform_into_line2.rb -c $OUT_SAMPLE -p 0 -f $length & doneSo,it should parallelize the for loop but somehow it still runs it in a sequence.However, if I do following: $CODES/transform_into_line2.rb -c $OUT_SAMPLE -p 0 -f blabla.txt &  $CODES/transform_into_line2.rb -c $OUT_SAMPLE -p 0 -f blabla2.txtIt does run it in parallel. Why doesn't a for loop work?
parallelize shell script
shell;parallelism
for length in $(ls $OUT_SAMPLE)should be rewrittenfor length in $(ls $OUT_SAMPLE)In fact you are looping on a single value.You can verify the values you're looping on with:for length in $(ls $OUT_SAMPLE) ; do  echo x$length doneTry the same without the double quotes!