[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: brace expansion and variable expansion
From: |
Gregory Seidman |
Subject: |
Re: brace expansion and variable expansion |
Date: |
Mon, 22 Mar 2004 09:37:40 -0500 |
User-agent: |
Mutt/1.5.4i |
On Mon, Mar 22, 2004 at 08:54:51AM -0500, Chet Ramey wrote:
} > On Sat, Mar 20, 2004 at 06:38:18PM -0500, Chet Ramey wrote:
} > } Gregory Seidman wrote:
} > } >Brace expansion does not occur after variable expansion.
} > }
} > } As is stated fairly clearly in the documentation.
} >
} > Is this documentation other than the man page? There is no mention of it
} > in the man page as far as I could see. And even documented, I'd consider
} > it a bug.
}
} How's this?
}
} Brace expansion is performed before any other expansions, and
} any characters special to other expansions are preserved in
} the result. It is strictly textual. Bash does not apply any
} syntactic interpretation to the context of the expansion or
} the text between the braces.
}
} This is from the BRACE EXPANSION section.
Hm. Seems I was wrong. That is, indeed, in the man page. And, as someone
pointed out, it is a design decision rather than a bug. I maintain that
it is a surprising and less than desirable design decision, and I would
encourage you to have variable substitution occur before brace
expansion, but I am using eval to get around it so it isn't crucial. If
I can't convince you to put variable substitution before brace
expansion, perhaps I can convince you to put an example of using eval to
get the same results in the man page?
} Chet
--Greg