[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: <( error
From: |
Greg Wooledge |
Subject: |
Re: <( error |
Date: |
Mon, 30 Nov 2009 08:52:58 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Sat, Nov 28, 2009 at 02:18:37PM +0100, Antonio Macchi wrote:
> $ hd <(echo -en \\0{0..3}{0..7}{0..7})
As for this, I wonder if you understand how bash handles this.
I know it certainly wasn't obvious to me! Due to the way the parsing
is done, the brace expansions inside the proces substitution cause
the process substitution to be duplicated. At least in bash 3.2.
Thus,
imadev:~$ bash-3.2.48 -c 'ls -l <(echo {a,b})'
prw------- 1 wooledg pgmr 0 Nov 30 08:45
/var/tmp//sh-np-1259598998
prw------- 1 wooledg pgmr 0 Nov 30 08:45
/var/tmp//sh-np-3711191228
The "ls -l <(echo {a,b})" is expanded exactly as if I had typed
"ls -l <(echo a) <(echo b)" instead.
However, this appears to have changed in bash 4.0:
imadev:~$ bash-4.0.35 -c 'ls -l <(echo {a,b})'
prw------- 1 wooledg pgmr 0 Nov 30 08:47
/var/tmp//sh-np-1259581617
(I wasn't previously aware of that change.)
Based on your question, I'm guessing you're in bash 3.2 or earlier, where
your "hd <(echo -en \\0{0..3}{0..7}{0..7})" is expanded as if you had typed
"hd <(echo -en \\0000) <(echo -en \\0001) <(echo -en \\0002) ..." and
runs into the FD exhaustion issue Chet already described.
I think you intended to get the bash-4.0 behavior, and not the bash-3.2
behavior.
- <( error, Antonio Macchi, 2009/11/28
- Re: <( error, Pierre Gaston, 2009/11/28
- Message not available
- Re: <( error, Chet Ramey, 2009/11/28
- Re: <( error,
Greg Wooledge <=
- Message not available