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

#!/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

猜你喜欢

转载自www.cnblogs.com/wolbo/p/12464490.html