在linux中并行执行多个shell

时间:2017-06-26 05:49:57

标签: linux shell

我尝试执行一个shell(outershell.sh)并行调用3个不同的shell:

#!/bin/sh
/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/GaSb/nmshell.sh &
/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/InAs/nmshell.sh &
/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/InP/nmshell.sh &

nmshell.sh的内容在以下三个位置相同:

#!/bin/sh
../MAIN/lm47.run lmctl 
../MAIN/lm47.run lmes 
echo "lmes done"

错误来自:

~/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort$ ./nmshell_multiprocessing.sh 
/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/InAs/nmshell.sh: 2: /home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/InAs/nmshell.sh: ../MAIN/lm47.run: not found
/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/GaSb/nmshell.sh: 2: /home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/GaSb/nmshell.sh: ../MAIN/lm47.run: not found
/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/InP/nmshell.sh: 2: /home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/InP/nmshell.sh: ../MAIN/lm47.run: not found/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/InAs/nmshell.sh: 3: /home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/InAs/nmshell.sh: ../MAIN/lm47.run: not found
/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/GaSb/nmshell.sh: 3: /home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/GaSb/nmshell.sh: ../MAIN/lm47.run: not found
lmes done
lmes done

我还尝试将../MAIN/lm47.run lmctl替换为完整路径/home/sujoy/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort/MAIN/lm47.run lmctl

现在,错误来自:

~/LMTO-NMTO/2*vLB-NMTO-47.ZB.46.6/06.gfort$  Error  : OPEN_SETUP: Error opening SETUP file
STOP  *** Program aborted ***
 Error  : OPEN_SETUP: Error opening SETUP file
STOP  *** Program aborted ***
 Error  : OPEN_SETUP: Error opening SETUP file
STOP  Error  : OPEN_SETUP: Error opening SETUP file
STOP  *** Program aborted ***
 *** Program aborted ***
lmes done
 Error  : OPEN_SETUP: Error opening SETUP file
STOP  *** Program aborted ***
lmes done
 Error  : OPEN_SETUP: Error opening SETUP file
STOP  *** Program aborted ***
 Error  : OPEN_SETUP: Error opening SETUP file
STOP  *** Program aborted ***
 Error  : OPEN_SETUP: Error opening SETUP file
STOP  *** Program aborted ***
lmes done

请帮我解决这个问题

0 个答案:

没有答案