parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parallel script with variable name


From: Shlomi Fish
Subject: Re: Parallel script with variable name
Date: Thu, 28 Feb 2019 09:12:21 +0200

Hi Ms. Fenderson,

On Thu, 28 Feb 2019 12:20:13 +1030
Lindsey Fenderson <address@hidden> wrote:

> Hi,
> 
> I'm very new to using GNU parallel, so this is probably a simple question
> but I haven't been able to figure out from the resources online how to do
> the following:
> 
> I have a very long script that I am running over multiple input files and I
> would like to parallelize this process. So for instance,
> 
> ls *filepattern* | parallel script.sh
> 
> seems to work as far as iterating over the files. However, I need to use
> the filename as a variable. So in my serial script I was doing this:
> 
> ls *filepattern* > filenames
> while read filenames; do
>   lots_of_stuff_$filenames
> done < filenames
> 
> So how can I get gnu parallel to incorporate the current filename it is
> using as a variable in my script?
> 

See:

* https://perl.plover.com/varvarname.html

* https://en.wikipedia.org/wiki/Associative_array

* https://en.wikipedia.org/wiki/Command-line_interface#Arguments

Regards,

        Shlomi

> Thanks



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
“So, who the hell is Qoheleth?” - http://shlom.in/qoheleth

Right to bear arms? In Soviet Russia, we have right to whole bear.
    — http://is.gd/EU4puV

Please reply to list if it's a mailing list post - http://shlom.in/reply .



reply via email to

[Prev in Thread] Current Thread [Next in Thread]