shell question
Eduardo Viruena Silva
mrspock at esfm.ipn.mx
Wed Apr 6 11:40:19 PDT 2005
On Wed, 6 Apr 2005, Richard Caley wrote:
> In article <63501.201.135.130.41.1112718721.squirrel at 201.135.130.41>, mrspock (m) writes:
>
> m> The problem is that I don't want to use the temporary
> m> file that I used above (stdout, stderr, out), I just
> m> want a "filter"
>
> If you want to rearange the output so that all the errors are after
> all the non errors, then you are going to need storage of some sort. I
> think that is logically unavoidable.
>
> There may be some kind of shuffle you can do with named pipes or
> something, but those kind of things have limited storage. Any time
> your command produces more error output than that space can hold, it
> will be stopped. Since you are not reading that stream until the main
> output is finished you'd then have a deadlock.
>
> --
> Mail me as MYFIRSTNAME at MYLASTNAME.org.uk _O_
> |<
Thank you, Richard.
Efectively, I found that is easier to create a temporary file with
one of the output files, in this case "stderr". Stderr is used,
in this case to create a listing of the data that the program is
using and, occasionally, it issues an error message, in this case
the program stops.
I finally programmed this process in this way:
program 2> tempfile | (cat && a2sp tempfile) | ps2pdf
As I already stated, my program is creating a PostScript output
in its stdout and a "listing" in the stderr file. a2ps is
converting this listing to PostScript and both of them, finally,
are converted to a PDF document with GhostScripts [in the ports].
Finally, the name "pipes" is very precise to describe what is
happening with the "streams"; obviously, if I want to process one
of the streams after the other one, I need to contain the "water"
of the second temporally.
Thanks for your time and your help.
Eduardo.
PS.
Perhaps you are interested in visiting my page:
http://michelle.esfm.ipn.mx/~mrspock/superspiro
Cut & Paste one of the examples and execute the program at the
end of the page.
More information about the freebsd-questions
mailing list