]> granicus.if.org Git - jq/commit
Make it easier to use jq with shebangs (fix #1044)
authorNicolas Williams <nico@cryptonector.com>
Tue, 15 Dec 2015 05:43:22 +0000 (23:43 -0600)
committerDavid Tolnay <dtolnay@gmail.com>
Tue, 15 Dec 2015 06:08:17 +0000 (22:08 -0800)
commit8f6f28c8d3fd6fb85439add3e812edeb5a887999
treebafea41cdd81cfe35c8f18103a6616a69405e6c3
parent856a4b2f3faf2d6312aad47599e102c8c48d1bdd
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.
src/main.c
tests/jq-f-test.sh [new file with mode: 0755]
tests/shtest