Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
How can i replace variables inside quotation marks in parallel

I want to run on parallel a command that inputs two variables into a gnuplot file, I tried with:

parallel 'OMP_NUM_THREADS=11 gnuplot -e 'alpha={}; file="{}.txt"' graf_separation_time.gp' ::: 0 1 2 3 4 5 6 7 8 9 10 

But it doesn't work, any suggestions?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You are being hit by using ' inside '. Quoting is hard to get right, so it is often easier to define a function, test it and then have GNU Parallel call that.

Untested:

gp() {
  OMP_NUM_THREADS=11 gnuplot -e 'alpha='"$1"'; file="'"$1"'.txt" graf_separation_time.gp'
}
export -f gp
parallel gp {} ::: 0 1 2 3 4 5 6 7 8 9 10 

This will probably also work:

parallel -q OMP_NUM_THREADS=11 gnuplot -e 'alpha={}; file="{}.txt" graf_separation_time.gp' ::: 0 1 2 3 4 5 6 7 8 9 10 

Read more: https://www.gnu.org/software/parallel/man.html#quoting

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!