Pipe capturing from stdout and stderr?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pipe capturing from stdout and stderr?

Rick Flower
Paolo et-al,

I've got a script that uses a pipe to issue commands and retrieve
the output for parsing.. All is good but I found out today that
one of the commands I'm invoking generates output to stderr in
addition to stdout.  The stderr stuff is sent directly to the
terminal session while gst sees the stdout stuff.. Is there a
way to also capture the stderr stuff and either parse it
separately (or discard) or merge the two together for combined
parsing?

I saw references to stderr in some of the scripts but not in
conjunction with the pipes..  Is there a way to do this?

Thx!

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Pipe capturing from stdout and stderr?

Paolo Bonzini-2
On 05/25/2010 02:19 AM, Rick Flower wrote:

> Paolo et-al,
>
> I've got a script that uses a pipe to issue commands and retrieve
> the output for parsing.. All is good but I found out today that
> one of the commands I'm invoking generates output to stderr in
> addition to stdout.  The stderr stuff is sent directly to the
> terminal session while gst sees the stdout stuff.. Is there a
> way to also capture the stderr stuff and either parse it
> separately (or discard) or merge the two together for combined
> parsing?

Having a full-blown class for spawning children processes is on the todo
list.

In the meanwhile, you can pass 2>&1 or 2>/dev/null at the end of the
popen command, though this will sacrifice portability to Windows of
course (but I guess you don't care).

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Pipe capturing from stdout and stderr?

Rick Flower
On Tue, 25 May 2010 09:29:56 +0200, Paolo Bonzini <[hidden email]> wrote:

> Having a full-blown class for spawning children processes is on the todo

> list.

Cool.. Good to know.

> In the meanwhile, you can pass 2>&1 or 2>/dev/null at the end of the
> popen command, though this will sacrifice portability to Windows of
> course (but I guess you don't care).

That is a restriction I can live with.. This particular script will be
Solaris only, so no issues there!  :)

Thanks!

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk