#! /bin/bash
echo "befor exit"
exit 1
echo "after exit"
脚本输出结果:
使用 bash ./test_exit.txt
befor exit
使用 . test_exit.txt
当前进程会退出。
#! /bin/bash
echo "befor exit"
exit 1
echo "after exit"
脚本输出结果:
使用 bash ./test_exit.txt
befor exit
使用 . test_exit.txt
当前进程会退出。