[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to build the parallel nature into the script?
From: |
Joe Sapp |
Subject: |
Re: how to build the parallel nature into the script? |
Date: |
Wed, 13 Dec 2017 07:14:50 -0500 |
On Wed, Dec 13, 2017 at 1:06 AM, paralleluser <paralleluser@fastmail.net> 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