-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
jq -e returns 4 for non-empty output with select() #1139
Comments
ryo1kato
added a commit
to ryo1kato/jq
that referenced
this issue
May 2, 2016
Return the code 1 or 4 based on last output, not last input. Fixes jqlang#1139
This was referenced May 2, 2016
ryo1kato
added a commit
to ryo1kato/jq
that referenced
this issue
Jul 28, 2018
* Set default error code to -4 in main(), Fixes jqlang#1142 * fix --exit-code with more than one object in input, Fixes jqlang#1139 - Return code 1 or 4 based on last output, not last input.
ryo1kato
added a commit
to ryo1kato/jq
that referenced
this issue
Jul 29, 2018
* Set default error code to -4 in main(), Fixes jqlang#1142 * fix --exit-code with more than one object in input, Fixes jqlang#1139 - Return code 1 or 4 based on last output, not last input.
nicowilliams
pushed a commit
that referenced
this issue
Dec 18, 2018
rbolsius
pushed a commit
to rbolsius/jq
that referenced
this issue
Sep 12, 2019
* Set default error code to -4 in main(), Fixes jqlang#1142 * fix --exit-code with more than one object in input, Fixes jqlang#1139 - Return code 1 or 4 based on last output, not last input.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
The man page says "Sets the exit status of jq to [...] 4 if no valid result was ever produced", but it seems the command returns 4 whenever last object is filtered out. (it should return '4' only for i=4 case above)
Similarly, I think this should return '1' instead of 4, because it's last output (which is not last one in the input, though) is 'false'.
The text was updated successfully, but these errors were encountered: