Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda