I have been running executables using spawn in nodejs all this while, now when i am trying to use spawn to run ubuntu commands like unset, export etc, they dont seem to work. I guess cause it is looking for executables. I even tried exec, that does not seem to work too. Any tips?
I have an ubuntu device running node, from the UI i need to set/unset env variables for proxy, e.g. http_proxy and no_proxy. Apart from export what other way can i do it via node? The env variables should be set system wide not just for the current process.
envoption forspawn?envoption forspawn, not theenvcommand. Anyway, if you want to execute shell commands you could usechild_process.execinstead ofspawn, asexecruns the command in a shell environment.