Shell commands are blocking -- work around?

Sarah Reichelt sarah.reichelt at gmail.com
Mon Nov 13 21:23:08 EST 2006


> Sarah: I'll try using your method first, why don't
> you use "send in 1 second until the file is not empty" or something like
> that, instead of a repeat loop with wait?

I guess I could have done it that way, but I would have to incorporate
a check for reading a file that was not yet complete, or for a file
reading error, if it was still in use by the shell. This works very
quickly if there is a connection, and handles a failure smoothly.

>
> BTW: from man sh, "REDIRECTION" Section
> The mysterious part.. still archane, but there's a touch of light here.
> and lots of other stuff in man sh, if you have the stomach for bash.
>
> =========
> Note  that  the order of redirections is significant.  For example, the
>         command
>                ls > dirlist 2>&1
>         directs both standard output and standard error to  the  file
> dirlist,
>         while the command
>
>    ls 2>&1 > dirlist
>
>         directs  only the standard output to file dirlist, because the
> standard
>         error was duplicated as standard output before the standard
> output  was
>         redirected to dirlist.
> =========
>

Thanks for this info, I'm getting worried now, because I almost
understand it :-)

Sarah



More information about the use-livecode mailing list