[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: |& in bash?
From: |
Greg Wooledge |
Subject: |
Re: |& in bash? |
Date: |
Tue, 22 Jan 2013 13:54:23 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Jan 22, 2013 at 07:45:10PM +0100, Andreas Schwab wrote:
> Greg Wooledge <wooledg@eeg.ccf.org> writes:
> > On Tue, Jan 22, 2013 at 06:56:31AM -0500, Steven W. Orr wrote:
> >> foo 2>&1 | bar
> > The pipeline is created first, and *then* the dup (2>&1) is
> > performed.
> This is true, but not obviously so. If you have the rule "redirections
> are processed from left to right", then this looks like an outlier (if
> you treat the pipe as another kind of redirection).
Well... that's the way the shell works. It's one of the things you need
to understand if you're working with complex shell scripts. Even if
the Bash |& extension is embraced by the community, you'll still need
to understand how foo 2>&1 | bar works if you're doing work in POSIX or
Bourne shells.
It kinda reminds me of the Linux newcomers who don't know how to do
gzip -dc foo.tar.gz | tar xvf - (and so on) because they've been trained
to use GNU tar's "z" flag instead, and therefore that piece of their
education hasn't been absorbed yet.
- Re: |& in bash?, (continued)
- 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 <=
- Re: |& in bash?, Bob Proulx, 2013/01/22
- Re: |& in bash?, Linda Walsh, 2013/01/26