bug-bash
[Top][All Lists]
Advanced

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

Re: |& in bash?


From: Dan Douglas
Subject: Re: |& in bash?
Date: Fri, 18 Jan 2013 15:10:47 -0600
User-agent: KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; )

On Thursday, January 17, 2013 06:53:26 PM John Caruso wrote:
> In article <mailman.17739.1358448318.855.bug-bash@gnu.org>, Chet Ramey 
wrote:
> > On 1/17/13 1:01 PM, John Caruso wrote:
> >> One feature of other shells (e.g. zsh and tcsh) I'd really love to have
> >> in bash is "|&", which redirects both stdout and stderr--basically just
> >> a shortcut for "2>&1 |".  Has this ever been considered for bash?
> > 
> > That has been in bash since bash-4.0.
> 
> I'm simultaneously happy and chagrined :-) (most of the servers I manage
> are on bash 3.x, so I hadn't encountered it).  Thanks.
> 
> - John

In scripts it breaks POSIX, conflicts with the coproc operator in kshes, and 
applies the redirections in an unintuitive order since the same operator 
redirects stdout first, then applies the stderr redirect after other 
redirections. It isn't very common to dump multiple streams into one pipe. I 
suggest avoiding |&.
-- 
Dan Douglas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]