It seems LiveCode waits until the result is in temp, then executes the next command. Actually I am not interested in the result. I want the shell script to be sent, then continue with the next command.
I seem to remember having a similar issue, and solved it by running an external bash script rather than running the commands directly from within livecode.
ghettocottage wrote:I seem to remember having a similar issue, and solved it by running an external bash script rather than running the commands directly from within livecode.
Yes, direct SHELL calls from within LC are always blocking!
ghettocottage wrote:I seem to remember having a similar issue, and solved it by running an external bash script rather than running the commands directly from within livecode.
Yes, direct SHELL calls from within LC are always blocking!
So LC will always wait for the result of the Shell command before continuing with next?
In some cases you can use "open process" instead. The "for neither" option will wait for neither read nor write, returning to the handler once the process is launched.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
You can get non-blocking shell commands in Livecode although this may be platform dependent. This isn't my idea, it comes from howsoft.com, http://www.howsoft.com/runrev/extensions/ "Shell without wait".
put "YOUR-SHELL-COMMAND" into tShellCommand
put "exec " & tShellCommand & " > /dev/null 2>/dev/null &" into tNoWaitShellCommand
get shell(tNoWaitShellCommand)
wsamples wrote:You can get non-blocking shell commands in Livecode although this may be platform dependent. This isn't my idea, it comes from howsoft.com, http://www.howsoft.com/runrev/extensions/ "Shell without wait".
put "YOUR-SHELL-COMMAND" into tShellCommand
put "exec " & tShellCommand & " > /dev/null 2>/dev/null &" into tNoWaitShellCommand
get shell(tNoWaitShellCommand)
I've been doing this a lot in the past and it can get tricky
depending on the scripts you are running...
Anyway, if you want to go that way, might be good
to check for nohup, screen and jobs commands.
But as I said, depends of your goal; hard to generalize.
Good luck,
Thierry
! SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!