It turns out that a tool for evaluating json that has been humming along nicely on my Mac wasn't as cross platform as I thought. Once I installed it on Ubuntu I got this error:
npm install -g pick_json
echo '{ "foo" : { "bar" : 2 } }' | pick_json -e foo.bar
/usr/bin/env: ‘node --harmony’: No such file or directory
It turns out that GNU env
thinks the command with the argument in the shebang line should be evaluated as one string. This does not happen on BSD. Manually evaluating the same command on the command line seems to be fine - the error only happens when it is written in the file.
$ /usr/bin/env node --harmony
>
I have tried various to no avail, so the question remains:
How can I pass options to the command in the shebang line that will work with GNU's env
command?