linux 的 exit
用于 shell 时, 表示退出 shell
有两种情况
- 直接执行
xx.sh
这种, 会退出子 shell, 不会影响父 shell - 使用
source
或者点号执行 shell, 例如source abc.sh
这种, 会退出父 shell
终端本身也是 shell 进程, 可以使用 exit
退出终端
linux 的 exit
用于 shell 时, 表示退出 shell
有两种情况
xx.sh
这种, 会退出子 shell, 不会影响父 shellsource
或者点号执行 shell, 例如 source abc.sh
这种, 会退出父 shell终端本身也是 shell 进程, 可以使用 exit
退出终端