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

206
Vistas
Last run with different options GNU Parallel

I've parallelized a for cycle in bash using GNU Parallel. This is a very simple example to show what I want to reach:

seq 10 | parallel -n0 echo "Hello World" &

I would like to detach from terminal all the run, except the last one, thus removing the & only in the last cycle. Is there a way to do this?

EDIT: Since I was not very clear, I'll try to explain myself in a better way:

I have a simulator starting, then with GNU parallel I launch many times the same script that connect with the simulator. I want all of them detaching from the terminal except the last one to avoid confusion with overlapping output.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

There is no option for that, but default is that the first job gets /dev/tty as input. So maybe you can run your last job first?

If you just want the output and not the input then this should work:

seq 10 | parallel echo Hello World '> {= $_= $job->seq() == total_jobs() ? "/dev/tty" : "/dev/null" =}'

(Requires version 20160122 or newer)

Otherwise a workaround is to save to files and output the last file:

seq 10 | parallel --files -n0 echo Hello World | tail -n1 | parallel -u cat
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