1

I am currently trying to use GNU parallel tool. I put two parameters. First one is java class file and second one is text file which contains the list of java methods.

cat $2 | while read line
do
    $ROOT_DIR/DRIVER_NAME $1 $line
done

And I want to use driver in parallel. How can I make this task in parallel using GNU parallel?

2 Answers 2

1

If your classes.txt file looks like this:

class1
class2
class3

Then, I assume you want something like this:

parallel --dry-run $ROOT_DIR/DRIVER_NAME "param1" < classes.txt 
Sign up to request clarification or add additional context in comments.

2 Comments

I think I wrote quite vague. First parameter is not class.txt format. It is literally java class file.
If you click edit under your question and improve it, I'll improve my answer to match.
1
cat $2 | parallel $ROOT_DIR/DRIVER_NAME $1 {}

Consider reading chapter 1-2 of https://doi.org/10.5281/zenodo.1146014 Your command line will love you for it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.