Is possible to use shebang in phantomjs code?

16 views
Skip to first unread message

peng...@gmail.com

unread,
Feb 8, 2018, 5:28:58 PM2/8/18
to phantomjs
The following example shows that shebang can not be used with phantomjs. Is there a walkaround?

$ ls -g -G
total 8
-rw-r--r-- 1  46 Feb  8 16:24 hello.js
-rwxr-xr-x 1 106 Feb  8 16:18 main.js
$ cat hello.js
console.log('Hello, world!');
phantom.exit();
$ phantomjs hello.js
Hello, world!
$ cat ./main.js
#!/usr/bin/env phantomjs

console.log('Hello, world!');
phantom.exit();
$ ./main.js # hangs


Reply all
Reply to author
Forward
0 new messages