Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

198
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda