Hi!
I want to run a script in parallel with different arguments.
eg.
start
script.sh argA script.sh argB script.sh argC
end
Can someone please tell how to achieve this.
Thanks in advance.
Hi!
I want to run a script in parallel with different arguments.
eg.
start
script.sh argA script.sh argB script.sh argC
end
Can someone please tell how to achieve this.
Thanks in advance.
script.sh argA &
script.sh argB &
script.sh argC &
Thank you very much!
you can
for ARG in argA argB argC
do
script.sh $ARG &
done
or
for ARG in A B C
do
script.sh arg$ARG &
done
too
It is good practise to issue a wait statement after the start of all the background processes to stop the parent shell from exiting before all of its children have finished.
for ARG in argA argB argC
do
script.sh $ARG &
done
wait