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.
This commit is contained in:
Nicolas Williams authored and David Tolnay committed 2015-12-14 22:08:17 -08:00
1 parent 856a4b2f3f
commit 8f6f28c8d3
3 files changed
+22 -1

No files matched your search

+2
View File
@@ -2,6 +2,8 @@
. "${0%/*}/setup"
PATH=$JQBASEDIR:$PATH $JQBASEDIR/tests/jq-f-test.sh > /dev/null
if [ -f "$JQBASEDIR/.libs/libinject_errors.so" ]; then
# Do some simple error injection tests to check that we're handling
# I/O errors correctly.