Running Node (or any unix cmd line program) from Shell from a LC Stack

Mark Waddingham mark at livecode.com
Mon May 9 14:09:41 EDT 2016


Yes - I think a 'login' type shell option would help here. (Which, if I recall correctly, causes the standard terminal setup scripts to run).

The reason the action of shell is to not use a login shell is because otherwise env vars you might want to pass to your new process might get clobbered by user settings which is (in general) probably not what you want.

For example if you set PATH temporarily to a specific folder to control the environment of your new process, it might be overridden by user settings causing breakage the other way. (Particularly if you need to use your own env vars which happened to also be set - for other reasons - in a user's shell environment).

Sent from my iPhone

> On 9 May 2016, at 00:11, Mark Wieder <mwieder at ahsoftware.net> wrote:
> 
>> On 05/08/2016 03:06 PM, [-hh] wrote:
>> On Mac, especially 10.11.x (with SIP enabled) , most user
>> installations MUST go into "/usr/local/bin".
>> So adjust the LC global $PATH to shell's $PATH. Minimal:
>> 
>> on preopenstack
>>   put "/usr/local/bin:" before $PATH
>>   -- put ":/usr/local/bin" after $PATH
>> end preopenstack
>> 
>> The second line prefers "system installations" before "user installations".
>> 
>> [Is it worth an enhancement request to add "/usr/local/bin" by default
>> to LC's global $PATH on Mac?]
> 
> Possibly. Maybe an addendum to http://quality.livecode.com/show_bug.cgi?id=10569, although that's four years old now (wow - even Mark Waddingham's enhancement requests don't get any love).
> 
> I think the documentation on the shell() command needs some work to cover things like this (hint for anyone who wants to take this task on). The shell you get when you invoke the shell() command is a bit the same as the shell you get in the terminal prompt and a bit not. You're running into one of the nots.
> 
> Another way around this is to specify the absolute path to node instead of letting the OS get it from the PATH env variable. You could also change the PATh setting in one of the config rc files... I'm not at my Mac right now, so I can't tell you which one.
> 
> -- 
> Mark Wieder
> ahsoftware at gmail.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list