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

280
Vistas
Apply in a single bsub command the Bourne shell background ampersand

I would like to employ the Bourne shell background ampersand as part of ONE bsub execution command.

Note that I don't want to use a .bash file but rather one bsub command line for executing the entire procedure.

Note that I also don't want to split my bsub content into a few bsub commands that wait upon one another, but rather to wrap into a single bsub command line a few internal unix commands that wait upon one another using the Bourne shell background ampersand.

the following attempt only produced the output of the first internal command (the liftOver command), but neither sort nor mv were executed.

bsub -q medium -J $i "liftOver $i mm10ToMm9.over.chain.gz ${i/.bed/.mm9.bed} ${i/.bed/.unlifted_to_mm9.bed} & sort -k1,1 -k2,2n ${i/.bed/.mm9.bed} > ${i/.bed/.mm9.bed}.srt & mv ${i/.bed/.mm9.bed}.srt ${i/.bed/.mm9.bed}"

Outside of the bsub this procedure could be written as follows:

liftOver $i mm10ToMm9.over.chain.gz ${i/.bed/.mm9.bed} ${i/.bed/.unlifted_to_mm9.bed} & 
sort -k1,1 -k2,2n ${i/.bed/.mm9.bed} > ${i/.bed/.mm9.bed}.srt & 
mv ${i/.bed/.mm9.bed}.srt ${i/.bed/.mm9.bed}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I don't know bsub but I could maybe give you a trick I use with batch, ssh and some other differed shells:

bsub -q medium -J $i <<<"liftOver $i mm10ToMm9.over.chain.gz ${i/.be/.mm9.bed} ${i/.bed/.unlifted_to_mm9.bed} &&
     sort -k1,1 -k2,2n ${i/.bed/.mm9.bed} > ${i/.bed/.mm9.bed}.srt &&
     mv ${i/.bed/.mm9.bed}.srt ${i/.bed/.mm9.bed}"

Maybe you have to change double quotes (") for quotes (') if $i have to be developped by bsub (again, I don't know this product)

or

bsub -q medium -J $i <<-eocmd
    liftOver $i mm10ToMm9.over.chain.gz ${i/.be/.mm9.bed} \
         ${i/.bed/.unlifted_to_mm9.bed} &&
    sort -k1,1 -k2,2n ${i/.bed/.mm9.bed} > ${i/.bed/.mm9.bed}.srt &&
    mv ${i/.bed/.mm9.bed}.srt ${i/.bed/.mm9.bed}
        eocmd

(warn: only a tabulation $'\t' could be placed before word eocmd)

Again, you may have to escape $ sign if $i have to be developped by bsub.

For working around $TERM environment not set, I use sometime:

bsub -q medium -J $i /bin/bash <<-eocmd
    ...
        eocmd

In the hope this could do the job.

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