Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jq -e decreases exit code by 10 when halt_error(number_bigger_then_9) is used #2214

Closed
edek437 opened this issue Nov 18, 2020 · 2 comments
Closed

Comments

@edek437
Copy link

edek437 commented Nov 18, 2020

Describe the bug
jq -e decreases exit code by 10 when halt_error(number_bigger_then_9) is used

To Reproduce
jq -en 'halt_error(9)'; echo $? # returns 9, it's ok
jq -en 'halt_error(10)'; echo $? # returns 0, 10 expected
jq -en 'halt_error(11)'; echo $? # returns 1, 11 expected
jq -en 'halt_error(110)'; echo $? # returns 100, 110 expected

Environment (please complete the following information):

  • OS and Version:
    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.7 LTS
    Release: 16.04
    Codename: xenial

  • jq version: 1.6

Additional context
NaN

@olorin37
Copy link

Or reproducing one-liner can be used:

for i in {0..255}; do jq -en "halt_error($i)"; echo "[$i] => $?"; done

Its output is located in file output-jq.txt. It was also jq-1.6.

Distributor ID: openSUSE
Description: openSUSE Tumbleweed
Release: 20201114

@itchyny
Copy link
Contributor

itchyny commented Jun 5, 2023

This is a bug of 1.6, but resolved by #1697 (6d3d275) and already fixed in the master branch.

@itchyny itchyny closed this as completed Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants