Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Apr 2005 11:32:01 -0500 (CDT)
From:      mrspock@esfm.ipn.mx
To:        freebsd-questions@freebsd.org
Subject:   shell question
Message-ID:  <63501.201.135.130.41.1112718721.squirrel@201.135.130.41>

next in thread | raw e-mail | index | archive | help

Hello FreeBSD gurus!

I address you in hope of enlightment.

Here is the problem:

I have a program that creates a PostScript output
and writes it to its standard output.

This program also writes diagnostic messages to
the standard error output at the same time, in
this case the messages are written in plain text.

I need to concatenate the standard output and
then standard error output in a file, but I need
to convert the standard output into PostScript
before the concatenation.

          program <stdin >stdout  2> stderr
          cat stdout > out
          a2ps stdout >> out

a2ps is in the ports and it converts plain text
into PostScript.

The problem is that I don't want to use the temporary
file that I used above (stdout, stderr, out), I just
want a "filter"

In a diagram, it can be seen as:

     stdin ==> program ==>  [stdout, a2ps(stderr)]


I have tried:

   cat stdin | program 2> tmp | ( cat && a2ps tmp )

but I still need a temporary file.

Can it be done?
Can you help me and tell me how ?

Thanks in advance.

           -Eduardo.

PS. Please, answer to my e-mail address, I am not
subscribed to the list.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?63501.201.135.130.41.1112718721.squirrel>