0
失敗,爲什麼會變成這樣的工作在命令行:當我將它賦值給變量的shell腳本里面解析在命令行工作,但在shell腳本
redis-cli info | grep instantaneous_ops_per_sec | cut -d : -f 2
...但不工作?例如,
num=`redis-cli info` | grep instantaneous_ops_per_sec | cut -d : -f 2
相關地,爲什麼分配的redis-cli info
原始輸出到殼變量,然後呼應它導致redis的-CLI輸出的亂碼版本?
我發誓我曾試過。 : -/ 爲什麼會將文件'cat'-ing到shell變量中,然後回顯該文件導致該文件的亂碼版本? – rivenmyst137
@ rivenmyst137聽起來像[這個問題](http://stackoverflow.com/questions/29378566/i-just-assigned-a-variable-but-echo-variable-shows-something-else) –