[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
- |& in bash?, John Caruso, 2013/01/17
- Re: |& in bash?, Chet Ramey, 2013/01/17
- Message not available
- Message not available
- Re: |& in bash?, John Caruso, 2013/01/21
- Re: |& in bash?, Steven W. Orr, 2013/01/22
- Re: |& in bash?, Greg Wooledge, 2013/01/22
- Re: |& in bash?, Bob Proulx, 2013/01/22
- Re: |& in bash?, Andreas Schwab, 2013/01/22
- Re: |& in bash?, DJ Mills, 2013/01/22
- Re: |& in bash?, Andreas Schwab, 2013/01/23
- Re: |& in bash?, Greg Wooledge, 2013/01/22