有没有办法禁用“写RSA密钥”控制台消息?
$ 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
我尝试了这些命令,结果相同:(
答案 0 :(得分:4)
使用strace
运行命令会显示该消息已写入STDERR
:
write(2, "writing RSA key\n", 16) = 16
^
因此您必须重定向STDERR
而不是STDOUT
:
openssl rsa -pubout ... 2>/dev/null