macosbashsetenv

setenv equivalent on mac?


I want to set an environment variable using setenv:

setenv NODE_ENV localhost  

But setenv gives me an error saying the command is not found. Does anyone know how to perform the MAC OSX equivalent of setenv? Thanks!


Solution

  • you want export

    NODE_ENV=localhost
    export NODE_ENV
    

    or on 1 line export NODE_ENV=localhost

    and this has nothing to do with OSX per se, more to do with bash vs (t)csh as your shell