On Wed, Dec 13, 2017 at 1:06 AM, paralleluser <[email protected]> wrote:
> Dear Friends,
>
> Given a shell script, script.bash, it takes one argument, $1, which is a file 
> name to process, like this:
> script.bash myfile.txt
>
> To parallelize this I can do:
> parallel script.bash ::: *.txt
>
> But what is the easiest way to build the parallel nature into the script so I 
> can do:
> script.bash *.txt
>
> and parallel does its magic behind the scenes?
>
> Thanks!...
>

Try replacing the shebang with (see
https://www.gnu.org/software/parallel/parallel_tutorial.html#Parallelizing-existing-scripts):

#!/usr/bin/parallel --shebang-wrap /bin/bash

-- 
Joe

Reply via email to