help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] group


From: Greg Wooledge
Subject: Re: [Help-bash] group
Date: Mon, 12 Dec 2016 10:22:45 -0500
User-agent: Mutt/1.4.2.3i

On Mon, Dec 12, 2016 at 08:08:28AM -0600, John McKown wrote:
> But with BASH, you can use process substitution:
> 
> some-program <(cat Region{,-*}.csv???)

For the record, note that you need a relatively new version of bash to
use a brace expansion inside a process substitution.

imadev:~$ bash-3.2 -c 'echo <(x {y,z})'
/var/tmp//sh-np-1481557898 /var/tmp//sh-np-3906145805
imadev:~$ bash-4.0 -c 'echo <(x {y,z})'
/var/tmp//sh-np-1481549372

In 3.2 and older, <(x {y,z}) was parsed in such a way that the brace
expansion happened FIRST, and was therefore equivalent to

<(x y) <(x z)

This was changed in bash 4.0.

Personally I never use brace expansions in a script.  I might VERY
occasionally use one in an interactive shell.



reply via email to

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