Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!samsung!uunet!mcsun!cernvax!markus From: markus@cernvax.UUCP (markus baertschi) Newsgroups: comp.unix.aix Subject: Re: Problems with popen on RS/6000 Keywords: popen, C, vmstat Message-ID: <2246@cernvax.UUCP> Date: 23 Aug 90 16:30:54 GMT References: <1990Aug15.203239.8832@eplrx7.uucp> <1990Aug23.133020.11170@world.std.com> Organization: CERN, Geneva, Switzerland Lines: 27 In <1990Aug23.133020.11170@world.std.com> madd@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@cernvm.cern.ch CERN (European Particle Research Center) Geneva, Switzerland