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!
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
Best for Mac is:
launchctl setenv NODE_ENV localhost
if you want to make the variable persistent and avoid rebooting.
See:
http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-slash-etc-slash-launchd-dot-conf/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With