如何在jq中从数组中删除空字符串项?
这是我的最佳猜测,但它似乎不起作用: 尝试
这是我的最佳猜测,但它似乎不起作用: 尝试
echo '["bob","","tim",""]' | jq '[ . [] | if length > 0 then . end ]'
期望输出:
["bob", "tim"]
错误:
. [] | if length > 0 then . end
jq: error: Possibly unterminated 'if' statement at <top-level>, line 1:
. [] | if length > 0 then . end
jq: 2 compile errors