jfh*_*fhr 6 command-line grep stdout
为了验证是否安装了 docker gpg 密钥,我运行了:
sudo apt-key fingerprint 0EBFCD88 | grep "9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88"
Run Code Online (Sandbox Code Playgroud)
这导致了以下输出:
Warning: apt-key output should not be parsed (stdout is not a terminal)
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
Run Code Online (Sandbox Code Playgroud)
我发现了这个关于如何规避警告的Stack Overflow 问题,但我找不到任何关于它为什么首先出现的来源?你不应该解析apt-key输出的原因是什么?
来自man apt-key:
DESCRIPTION
apt-key is used to manage the list of keys used by apt to authenticate
packages. Packages which have been authenticated using these keys will
be considered trusted.
Note that if usage of apt-key is desired the additional installation of
the GNU Privacy Guard suite (packaged in gnupg) is required. For this
reason alone the programmatic usage (especially in package maintainer
scripts!) is strongly discouraged. Further more the output format of all
commands is undefined and can and does change whenever the underlying
commands change. apt-key will try to detect such usage and generates
warnings on stderr in these cases.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7031 次 |
| 最近记录: |