Create an executable for a program in an interpreted language: Difference between revisions

Line 385:
The trick to using jq in the shebang line is NOT to specify an argument for the -f option.
 
AAssuming the jq program is on the PATH, a suitable shebang line for a script that reads from stdin would be:
 
<pre>
#!/usr/bin/env jq -Mff
</pre>
 
Alternatively, the full pathname can be specified, e.g. /usr/local/bin/jq -f
 
Other jq options can also be specified.
 
The file with the shebang line and program must of course be made executable (e.g. by running `chmod +x FILENAME`).
2,460

edits