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

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

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 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