bug-bash
[Top][All Lists]
Advanced

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

Brace expansion clones <() process substitutions


From: Doug Simpson
Subject: Brace expansion clones <() process substitutions
Date: Mon, 06 Nov 2000 09:28:42 -0500

Greetings,

In bash version 1.14.7(1) under Redhat Linux 6.1:

#
# larg - function to list arguments
#

larg() {
   local i=1
   while [ $i -le $# ]; do
      eval echo "\$$i"
      let i+=1
   done
}

$ larg <( larg x a{d,c,b}e ) 
/dev/fd/3
/dev/fd/4
/dev/fd/5
$
$ larg <( echo x a{d,c,b,e} )   ;# to eliminate potential 'larg' weirdness
/dev/fd/3
/dev/fd/4
/dev/fd/5
$
$ cat <( larg x a{d,c,b}e )
x
ade
x
ace
x
abe
$

It appears the brace expansion is

   cat <( larg x ade ) <( larg x abe ) <( larg x ace )

rather than

   cat <( larg x ade abe ace )

Is this a feature or a bug?  I would say bug, but then I am a newbie to both 
unix and bash.  I've read the info page ten times on brace expansion.  If this 
cloning of <() is normal behavior, please explain to me how the effects of the 
expansion could extend beyond the whitepace on either side of a{d,c,b}e.

I would have searched for a fix in a later release, but the archive for this 
list did not appear to be searchable without a download.

Thanks,

Doug

Doug Simpson
Router Engineer
State of Georgia
404.463.8468




reply via email to

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