【发布时间】:2017-06-21 15:11:24
【问题描述】:
我尝试读取 bash 命令“openssl help”的输出并将其放入字符串变量中以供进一步处理。
确切地说,我想测试所有 Cipher 命令。
首先,我尝试读取命令“openssl ciphers”的输出。但我只有密码而不是密码命令。但是,如果我键入“openssl help”,则会显示密码命令。问题是现在命令的输出没有保存在我的变量中。
CIPHER=`openssl ciphers`
echo "Output:"
echo $CIPHER
这行得通。但不幸的是 $CIPHER 的内容不是我需要的。
CIPHER=`openssl help`
echo "Output:"
echo $CIPHER
这不起作用。变量 CIPHER 为空。为什么??
【问题讨论】:
-
你想要
openssl ciphers还是openssl help?