在 Linux 或 MacOS 中发出以下两个命令时,Shell 会话退出并且没有显示任何错误消息。
➜ ~ sh
sh-3.2$ exec<>5
sh-3.2$ exit ==> 'exit' was issued by the shell itself!
这是 '/bin/sh' 的缺陷吗?任何人都可以提供任何见解吗?
/bin/sh 在我的 RHEL 上:
-sh-4.1$ sh --version GNU bash,版本 4.1.2(1)-release (x86_64-redhat-linux-gnu) 版权所有 (C) 2009 Free Software Foundation, Inc.
/bin/sh 在我的 MacOS 上:
➜ ~ sh --version GNU bash,版本 3.2.57(1)-release (x86_64-apple-darwin14) 版权所有 (C) 2007 Free Software Foundation, Inc.