有什么方法可以禁用控制台消息“写入 RSA key ”?
$ openssl rsa -pubout -outform DER -inform PEM -in /tmp/res/chrome.pem -out 1 > /dev/null
writing RSA key
$ openssl rsa -pubout -outform DER -inform PEM -in /tmp/res/chrome.pem -out 1
writing RSA key
$ openssl rsa -pubout -outform DER -inform PEM -in /tmp/res/chrome.pem > /dev/null
writing RSA key
我尝试了这些命令,结果相同:(
最佳答案
使用 strace
运行命令显示消息被写入 STDERR
:
write(<b>2</b>, "writing RSA key\n", 16) = 16
^
所以你必须重定向 STDERR
而不是 STDOUT
:
openssl rsa -pubout ... 2>/dev/null
关于bash - openssl:如何在控制台中禁用 "writing RSA key"消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16608154/