Challenge: who can background this shell command?

Matthias Rebbe matthias_livecode_150811 at m-r-d.de
Thu Aug 1 09:01:10 EDT 2019


I´ve tried my suggestion now with a freshly installed version of Mailhog. Just to make sure that it works with a background process. Maihog normally has to be started from Shell and rund as long as the terminal window stays open.

When executing this script
put "/users/matthias/downloads/temp/MailHog > /dev/null 2>&1 &" into tShell

put shell(tShell)

answer 1


MailHog started and runs in background while the script continued and showed the answer dialog.

Regards,
Matthias


Matthias Rebbe

free tools for Livecoders:
InstaMaker <https://instamaker.dermattes.de/>
WinSignMaker Mac <https://winsignhelper.dermattes.de/>

> Am 01.08.2019 um 14:39 schrieb Matthias Rebbe via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>:
> 
> This let me run it without blocking. It redirects the stdout and stderr if i recall it correct.
> 
> "vi > /dev/null 2>&1 &"
> 
> 
> 
> Matthias Rebbe
> 
> free tools for Livecoders:
> InstaMaker <https://instamaker.dermattes.de/ <https://instamaker.dermattes.de/>>
> WinSignMaker Mac <https://winsignhelper.dermattes.de/ <https://winsignhelper.dermattes.de/>>
> 
>> Am 01.08.2019 um 13:55 schrieb David Bovill via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>>:
>> 
>> The challenge is to figure out a technique we can use in Livecode to be
>> able to call long running shell processes (typically something like an http
>> server process) without blocking Livecode.
>> 
>> To test this without asking anyone to install some cli I thought we could
>> try it with an existing long running process that everyone should have in
>> their terminal - vi
>> 
>> So how do you:
>> 
>> *put* shell ("vi")
>> 
>> I've tested this and it does not crash here on latest OSX. You do have to
>> type command-period a few times to unblock things - but it is more or less
>> safe to try in the message box.
>> 
>> I've also tried:
>> 
>> *put* shell ("vi &")
>> 
>> The aim is to out the process in the background, or some other technique -
>> like make a bash script that contains the line that launches vi (ie "vi") -
>> or perhaps uses screen or tmux, or some trick in Livecode (open process
>> does not work for this on OSX)...
>> 
>> Who can crack this tricky nut :)
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto: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 <http://lists.runrev.com/mailman/listinfo/use-livecode>
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com <mailto: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 <http://lists.runrev.com/mailman/listinfo/use-livecode>



More information about the use-livecode mailing list