shell中exit命令不退出脚本
摘要:好久不用shell了,今天碰到一个坑,发现exit后,shell脚本还会运行。 exit 如果用在管道中的话,他会退出当前管道,但当前脚本还会运行。因为他只是结束管道这个子进程。 所以我们还需要在加一句 [ $? -eq 99 ] || exit
阅读全文
posted @ 2016-03-25 17:26
posted @ 2016-03-25 17:26
posted @ 2016-01-09 20:10
posted @ 2016-01-05 17:25
posted @ 2016-01-05 11:43