Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: bash-style substrings & subarrays
- X-seq: zsh-workers 28423
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx (Zsh hackers list)
- Subject: Re: PATCH: bash-style substrings & subarrays
- Date: Fri, 19 Nov 2010 10:01:45 -0800
- In-reply-to: <27165.1290012857@xxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <27165.1290012857@xxxxxxx>
On Nov 17, 4:54pm, Peter Stephenson wrote:
}
} This implements the ${NAME:OFFSET} and ${NAME:OFFSET:LENGTH} syntax.
} This is basically for compatibility; we don't need the extra
} functionality, but it's a syntax people are nowadays assuming they can
} use.
I'm wondering whether :OFFSET:LENGTH shouldn't always use KSH_ARRAYS
semantics, or be a valid syntax only when KSH_ARRAYS is set? If it's
for compatibility with people who are assuming it works, those people
are also going to assume it has zero-offset, aren't they?
There may be some error cases not yet caught:
schaefer<508> foo=123456789
schaefer<509> unset y x
schaefer<510> echo ${foo:$y:$x}
zsh: bad math expression: illegal character: Ý
That Ý looks like uninitialized memory garbage.
--
Messages sorted by:
Reverse Date,
Date,
Thread,
Author