I have a following line:
for length in "$(ls $OUT_SAMPLE)"
do $CODES/transform_into_line2.rb -c $OUT_SAMPLE -p 0 -f $length &
done
So,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.txt
It does run it in parallel. Why doesn't a for loop work?
for length in "$OUT_SAMPLE"/*
. https://github.com/koalaman/shellcheck/wiki/Sc2045 – Mingye Wang Dec 12 '15 at 06:37