Skip to content

Instantly share code, notes, and snippets.

@bowenyang007
bowenyang007 / how_to_make_a_script.md
Created October 15, 2015 20:09 — forked from joshwyatt/how_to_make_a_script.md
How to make scripts you can access globally from the terminal

How to make a globally available executable script in the scripting language of your choice

  • Locate the path to the interpreter for the language you are writing in with the which command.

      which node
      which python
      which bash
      which ruby
    
  • Add that path as an interpreter directive (using #!) on the first line of your script. For example if you want to write a node script and which node returned /usr/local/bin/node, the first line of your script should be: