1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00
stedolan-jq/tests/jq-f-test.sh
Nicolas Williams 8f6f28c8d3 Make it easier to use jq with shebangs (fix #1044)
Allow a continuation on a comment immediately after a shebang to make
this traditional hack possible:

    #!/bin/sh
    # this next line is ignored by jq \
    exec jq -f "$0" "$@"
    # jq code follows

But continue only on the first line following a shebang, and only if
it's a comment.
2015-12-14 22:08:17 -08:00

5 lines
118 B
Bash
Executable File

#!/bin/sh
# this next line is ignored by jq, which otherwise does not continue comments \
exec jq -nef "$0" "$@"
true