You are not logged in.
Hi,
I have a script look like this:
test.sh:
#!/usr/bin/env node --harmony
console.log("hello")
When I run the script, it says "/usr/bin/env node --harmony: no such file or directory".
If I remove the "--harmony" on the first line, then it works.
What am I missing something?
Thanks!
Last edited by wrb302 (2013-08-19 01:29:05)
Offline
I don't think you can pass command line arguments through env like that. Just remove env and call node directly and it works:
#!/usr/bin/node --harmony
...
edit:
If you really need to use env to allow for node to be located somewhere else in the path, well then you still don't really need to use env:
#!/bin/sh
exec node --harmony <<EOF
console.log("hello")
EOF
Last edited by Trilby (2013-08-19 00:32:25)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Hi Trilby,
Thanks for your quick response. Actually this is a script in a node module I am trying to install: https://github.com/Sage/streamlinejs/bl … /bin/_node
This script actually works on Mac without problem.
Also, from man env it looks like it accepts arguments for command:
NAME
env - run a program in a modified environment
SYNOPSIS
env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
And I just tried running "/usr/bin/env node --harmony" in the console directly, it also works.
So I guess this is a quirk of Arch linux?
Offline
Looks like this is a defect in that script.
Thanks falconindy!
Offline