Sunday, April 20, 2008

script run background

#!/bin/bash
echo $1
cp test.sh test2.sh
mv test.sh /tmp
java -version
echo "sang says => ${1}"
excommand="${1}"
eval $excommand



#!/bin/bash
excommand="nohup jab_simul.sh jab_simul_max${1}.xml"


#!/bin/bash
excommand="nohup /root/test2.sh jab_simul_max${1}.xml > test${1}.log &"
eval $excommand



#!/bin/bash
excommand="nohup /home/sang/jabsimul/jab_simul/jab_simul jab_simul_max${1}.xml > test${1}.log &"
echo $excommand
eval $excommand

#!/bin/bash
excommand="nohup /home/sang/jabsimul/jab_simul/jab_simul eidosimul_max${1}.xml > eitest${1}.log &"
echo $excommand
eval $excommand


ยังงี้ก็ไม่ต้องเปิดหน้าต่างเยอะๆแล้ว


มี tip ถ้าเรารันปกติเราใช้ Ctrl^Z ในการส่งมันไป background ได้
แล้วพิมพ์ fg ก็กลับมาที่ UI ปกติได้

No comments: