Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: RC_EXPAND_PARAM bug
- X-seq: zsh-workers 3388
- From: Geoff Wing <mason@xxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: RC_EXPAND_PARAM bug
- Date: Wed, 30 Jul 1997 13:04:11 +1000
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <970729092705.ZM16897@xxxxxxxxxxxxxxxxxxxxxxx>; from Bart Schaefer on Tue, Jul 29, 1997 at 09:27:05AM -0700
- Organization: PrimeNet Internet Consultancy
- References: <199707290736.DAA03285@xxxxxxxxxx> <970728092639.ZM12131@xxxxxxxxxxxxxxxxxxxxxxx> <199707290604.CAA02191@xxxxxxxxxx> <slrn5tr7vr.jsh.mason@xxxxxxxxxxxxxxxxxxxxx> <970729092705.ZM16897@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote about Re: RC_EXPAND_PARAM bug:
:On Jul 29, 7:47am, Geoff Wing wrote:
:} :The logic is that the string after the rc-param, 1${^^x}, is expanded,
:} :producing two strings, 1x y, which is combined with 1a 1b. It is true
:} I don't get this, shouldn't 1${^^x} produce one string "1x y"? And then the
:} expansion of 1${^a}1${^^x} be the string "1a1x y 1b1x y"? Your logic
:} indicates to me that it's producing array like thingies. Is this dependant
:} on some other wierd option? Please explain before I go mental.
:The trick there is that x is an array variable, so it produces two strings.
Yes, but I still don't get it. ^^ should prevent expansion, shouldn't it.
${^spec}
Turn on the RC_EXPAND_PARAM option for the evaluation of spec;
if the ^ is doubled, turn it off. When this option is set, array
expansions of the form foo${xx}bar, where the parameter xx is set
to (a b c), are substituted with fooabar foobbar foocbar
instead of the default fooa b cbar.
So, it seems to me that it should be
% echo 1${^a}
1a 1b
% echo 1${^a}1
1a1 1b1
% echo 1${^a}1${^x}
1a1x 1a1y 1b1x 1b1y # in another order?
% echo 1${^a}1${^^x}
1a1x y 1b1x y
--
Geoff Wing [mason@xxxxxxxxxxxxxxx] Phone : +61-3-9818 2977
Technical Manager: PrimeNet Computer Consultants Facsimile: +61-3-9819 3788
Web: <URL:http://www.primenet.com.au/> Mobile : 0412 162 441
[ Boulderdash: <URL:http://ciips.ee.uwa.edu.au/~williams/bd/> ]
Messages sorted by:
Reverse Date,
Date,
Thread,
Author