jeudi 17 juin 2021

What is wrong with "jq: error: syntax error, unexpected end"? [duplicate]

if .data then
(
 ["exOrEffDate", "type", "amount", "declarationDate", "recordDate", "paymentDate"]
 , (.data.dividends.rows[] | [.exOrEffDate, .type, .amount, .declarationDate, .recordDate, .paymentDate])
 ) | @tsv
end

I have the above jq code. jq shows the following error. I can not see what is wrong with the code. Could anybody show me how fix the problem?

jq: error: syntax error, unexpected end (Unix shell quoting issues?) at <top-level>, line 6:
end
jq: error: Possibly unterminated 'if' statement at <top-level>, line 1:
if .data then
jq: 2 compile errors

Aucun commentaire:

Enregistrer un commentaire