在bash中与exec一起使用超时

时间:2019-04-10 14:06:50

标签: bash pipe

如何在加载matlab并发生超时后将其杀死?

rm -rf pipe
mkfifo pipe

time matlab -nosplash -nodesktop <pipe 2>&1 | tee sub.log > /dev/null &
pid=$!
exec 3> pipe
sleep 25s
echo "MyMatlab1('1','2');quit" >&3
####timeout 600 exec 3>&-    #alternative?

参考: Named pipe does not wait until completion in bash

0 个答案:

没有答案