Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "#!/bin/env" mean (at the top of a node.js script)?

I found serval node.js projects that have this at top of their app.js (as in this openshift program):

#!/bin/env node 

What does this mean? How does this work? Where is it useful?

like image 634
hh54188 Avatar asked Feb 25 '13 06:02

hh54188


People also ask

What does the fox say Meaning?

Speaking of the meaning of the song, Vegard characterizes it as coming from "a genuine wonder of what the fox says, because we didn't know". Although interpreted by some commentators as a reference to the furry fandom, the brothers have stated they did not know about its existence when producing "The Fox".

What does a real fox say?

The most commonly heard red fox vocalizations are a quick series of barks, and a scream-y variation on a howl. All fox vocalizations are higher-pitched than dog vocalizations, partly because foxes are much smaller. The barks are a sort of ow-wow-wow-wow, but very high-pitched, almost yippy.

How can I identify a song by sound?

On your phone, touch and hold the Home button or say "Hey Google." Ask "What's this song?" Play a song or hum, whistle, or sing the melody of a song. Hum, whistle, or sing: Google Assistant will identify potential matches for the song.


2 Answers

The full line from your example is:

#!/bin/env node 

This simply means that the script should be executed with the first executable named 'node' that's found in your current PATH.

The shebang (#!) at the start means execute the script with what follows. /bin/env is a standard unix program that looks at your current environment. Any argument to it not in a 'name=value' format is a command to execute. See your env manpage for further details.

like image 166
sockmonk Avatar answered Sep 18 '22 21:09

sockmonk


env is a shell command used to specify an interpreter.

like image 37
Chris Ledet Avatar answered Sep 21 '22 21:09

Chris Ledet