Ear*_*rlz 9 osx bash man bsd shell-builtin
所以,我需要弄清楚“exec”是如何工作的。然而,这样做man exec
让我看到了一个 99% 无用的手册页,描述了什么是 bash 内置函数。当然,它也使用许多其他手册页(例如 cd、chdir 等)执行此操作。
如何查找我感兴趣的实际实用程序的手册页,而不是内置手册页?
我的操作系统是 Mac OSX,但我在其他操作系统上也有这个
可以使用命令来获取 shell 内置函数的文档
help
。例如:
$ help exec
exec: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
Replace the shell with the given command.
Execute COMMAND, replacing this shell with the specified program.
ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,
any redirections take effect in the current shell.
Options:
-a name pass NAME as the zeroth argument to COMMAND
-c execute COMMAND with an empty environment
-l place a dash in the zeroth argument to COMMAND
If the command cannot be executed, a non-interactive shell exits, unless
the shell option `execfail' is set.
Exit Status:
Returns success unless COMMAND is not found or a redirection error occurs.
Run Code Online (Sandbox Code Playgroud)
否则,您可以运行man bash
然后在其中搜索(/\bexec\b
在这种情况下,假设一个不太像的寻呼机,可能通过键入)。