I have my script using while read
to process some file line by line..
When I do:
head -n5 file1 | ./myscript.sh
I get my results well.
But trying to parallelize it using gnu parallel
:
head -n5 file1 | parallel -j 4 ./myscript.sh
yields result
file empty!?
I tried also with:
parallel -j 4 -a file1 ./myscript.sh
but still doesn't work. I was trying to do similar to what they say in documentation, but without any success. What am I doing wrong?
EDIT:
Maybe this can help:
head -n5 file1 | parallel -a - -j 4 echo #this works
head -n5 file1 | parallel -a - -j 4 ./myscript #this doesn't