无需手动输入取消设置

Abd*_*UMI 4 command-line bash repository manpage

我尝试显示unset命令行的帮助页面,结果得到以下输出:

无需手动输入取消设置

我看到这个问题,因为它们很相似,但是,它不能解决这个问题。事实上,这个问题已经通过使用这个 cmd 安装一些软件包得到解决:

sudo apt-get install manpages-posix manpages-posix-dev
Run Code Online (Sandbox Code Playgroud)

所以,我尝试做同样的事情;除了通过 unset 修改 posix ,所以我这样做:

sudo apt-get install manpages-unset
Run Code Online (Sandbox Code Playgroud)

结果是:

无法找到包 manpages-unset

明确的问题是:

如何显示未设置的手册

Syl*_*eau 9

由于setunset是shell内建的,你需要使用help命令来获得其详细的帮助:

$ help unset
unset: unset [-f] [-v] [-n] [name ...]
Unset values and attributes of shell variables and functions.

For each NAME, remove the corresponding variable or function.

Options:
  -f    treat each NAME as a shell function
  -v    treat each NAME as a shell variable
  -n    treat each NAME as a name reference and unset the variable itself
    rather than the variable it references

Without options, unset first tries to unset a variable, and if that fails,
tries to unset a function.

Some variables cannot be unset; also see `readonly'.

Exit Status:
Returns success unless an invalid option is given or a NAME is read-only.
Run Code Online (Sandbox Code Playgroud)


c0r*_*0rp 5

set并且unset不是第三方二进制文件。它们是Shell Builtins。这意味着它们在“内部”外壳中。如果您使用的是 bash,则可以运行type来检查它。

$ type set
set is a shell builtin
$ type unset
unset is a shell builtin
Run Code Online (Sandbox Code Playgroud)

引用自 Bash 参考:

内置命令包含在 shell 本身中。当内置命令的名称用作简单命令的第一个单词时(请参阅第 3.2.1 节简单命令),shell 会直接执行该命令,而不调用其他程序。内置命令是实现单独实用程序不可能或不方便获得的功能所必需的。

要查找手册,unset只需运行man bash. 或者您可以在此处找到信息。


归档时间:

查看次数:

2305 次

最近记录:

10 年,7 月 前