parallel
[Top][All Lists]
Advanced

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

Parallel script with variable name


From: Lindsey Fenderson
Subject: Parallel script with variable name
Date: Thu, 28 Feb 2019 12:20:13 +1030

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?

Thanks
  

reply via email to

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