Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 仅限AWK命令打印编号_Shell_Awk_Command_Jq_Json - Fatal编程技术网

Shell 仅限AWK命令打印编号

Shell 仅限AWK命令打印编号,shell,awk,command,jq,json,Shell,Awk,Command,Jq,Json,虽然我得到了“XXX,version”,但我试图用这个代码打印数字。你知道我该怎么修吗 wget-O-https://bch-chain.api.btc.com/v3/block/latest 2> /dev/null | awk-F':“{print$3}” 613777,“版本” 非常感谢您的帮助。像这样,使用合适的解析器: 输出 curl -s 'https://bch-chain.api.btc.com/v3/block/latest' | jq '.data.height' 613

虽然我得到了“XXX,version”,但我试图用这个代码打印数字。你知道我该怎么修吗

wget-O-https://bch-chain.api.btc.com/v3/block/latest 2> /dev/null | awk-F':“{print$3}”
613777,“版本”

非常感谢您的帮助。

像这样,使用合适的解析器:

输出
curl -s 'https://bch-chain.api.btc.com/v3/block/latest' | jq '.data.height'
613777