[racket] Embedding multiline shell scipts

From: Manfred Lotz (manfred.lotz at arcor.de)
Date: Sun Feb 6 11:21:36 EST 2011

On Sun, 6 Feb 2011 16:14:42 +0100
Thomas Chust <chust at web.de> wrote:

> 2011/2/6 Manfred Lotz <manfred.lotz at arcor.de>:
> > [...]
> > I don't know how to merge stdout and stderr in proper sequence.
> > [...]
> 
> There is no such thing as proper sequencing of data flowing through
> different streams.
> 
> Due to buffering in system libraries and the operating system kernel
> it is also entirely impossible to reliably process the output data in
> the exact sequence it was produced by the external process.
> 

But there is a sequence of output lines (going to stdout and stderrr)
by the external process. My question is if there is a possibility to
catch that sequence of events it in process. 

Your answer tells me that in process I'm too late to catch the original
sequence of output lines.


With a single command I could do something like this:

(define my-cmd "find . -type f 2>&1")

However, this is not really nice when processing a couple of commands
thru process.

With zsh shell something like this works:

(define my-cmd "/bin/zsh -c '{
      find ~/tmp -type f
      unmae -a   #typo to get an error message
      id
   } 2>&1'
")

Don't know how this will be done in bash.


-- 
Manfred





-- 
Manfred




Posted on the users mailing list.