Problems with popen on RS/6000

markus baertschi markus at cernvax.UUCP
Fri Aug 24 02:30:54 AEST 1990


In <1990Aug23.133020.11170 at world.std.com> madd at world.std.com (jim frost) writes:

>There is a general problem with many utilities when their output is
>piped or redirected where output will be buffered unexpectedly.

>For kicks sometime, try redirecting a make that contains multiple
>files with errors to a file.  You'll get all the errors from cc,
>followed by all the "cc" lines from make.  Make appears to buffer its
>output until termination.  This also happens when piping to a pager.

  Jim,

  The solution for your redirection problem is quite easy. I suspect you
  used a construct like 
    make >logfile 2>logfile
  which behaves exactly like you said.
  If you change it slightly to
    make >logfile 2>&1
  suddenly the contents of the file will look like the output to the
  console with error & stdout output mixed. Why ? '2>&1' just redirects
  stderr to the same file as stdout (before buffering is done).

  Markus
-- 
  Markus Baertschi				| markus at cernvm.cern.ch
  CERN (European Particle Research Center)
  Geneva, Switzerland



More information about the Comp.unix.aix mailing list