简体   繁体   中英

AWK command print number only

I am trying to print just the number with this code, although I get the "XXX,version". Any ideas how I could fix it?

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

613777,"version"

Any help is greatly appreciated.

Like this, using a proper parser: :

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

output

613777

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM