On Thu, Nov 01, 2001 at 10:24:37PM -0800, Jacob Meuser wrote:
> On Thu, Nov 01, 2001 at 05:54:24PM -0800, Cory Petkovsek wrote:
> > I'm working on creating a centralized logging facility for my NT servers.
> > Currently my linux servers email me highlights of their logs using logcheck.
> > 
> > 
> > Through this process, I discovered some interesting redirection usage that I
> > hadn't seen before:
> > "eldump -? 2>&1 | more"
> > 
> > I figure this means take standard error(2) and merge it with standard
> > out(1).  Right?
> 
> I would suggest reading the bash manpage, under the section REDIRECTION.
> 
> Pipe redirection doesn't work.  If you read the manpage, it should be
> clear why this is.
> 

In fact, it does.

  cat bah 2>&1 |cat >j

will leave an error message in "j", assuming that there is no file
named "bah".

Redirecting standard error is one of the most valuable shell tricks
for error catching.

Randolph

Reply via email to