Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Piping stderr?



>>>>> "Josh" == Josh Glover <jmglov@example.com> writes:

    Josh> Is it possible to pipe (not redirect) stderr?

    Josh> Ideas?

zsh is the "Shell of the Gods".  But if you won't listen to the doctor
and continue to bash yourself ;-) try

gcc --blow-chunks 2>&1 >catch-stdout | less

will give you a zero-length file named catch-stdout and "gcc: No input
files" in less.

If you want something more flexible (ie, piping both to different
places), you'll need named pipes.  Alternatively you could try process
substitution, but the idiom

gcc --blow-chunks 2>(less) >catch-stdout

confuses bash pretty good.

    Josh> 'foo | tee log' will handle that for stdout, but not stderr

foo 2>&1 | tee log

-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
 My nostalgia for Icon makes me forget about any of the bad things.  I don't
have much nostalgia for Perl, so its faults I remember.  Scott Gilbert c.l.py


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links