执行阻塞命令后返回当前目录

 

 

 

#!/bin/bash
cd ./tools/patchinstall
function handle_int()
{
    kill $BCPID
    exit
}
trap handle_int INT
./startpatch-linux.sh &

BCPID=$!

cd /FIShare/gscloud
wait

 

 

 

 

参考:

https://serverfault.com/questions/101278/bash-blocking-processes

https://askubuntu.com/questions/287350/start-a-new-process-without-blocking-the-terminal

posted @ 2020-03-11 18:30  wolbo  阅读(96)  评论(0编辑  收藏  举报