Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
The ~ parameter expansion flag: bug or misunderstanding
- X-seq: zsh-workers 33104
- From: Clint Hepner <clint.hepner@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: The ~ parameter expansion flag: bug or misunderstanding
- Date: Wed, 3 Sep 2014 10:58:23 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=+Rg09yLWOrrRAIShzTnsxISxUHJOHmnf1nFOyaYft0E=; b=uevD9rPtyn0eIxh62VwFq52yZI6ofWUxll4d3tt1QcFdALN6TRSEV/GHq8MtcXkgmI 29tOCWK2L3FCVUzLs3b3lgb57PbuBQka8tcwG5T8rp7SAV522V2ivrdxQIp5k2QOLkoL m4xdmHWfD72o0qQkaAde0IASElr3zhI6l/PIxXefoZRqtcLL0vWGQXGn9PZTykiAlOtf Ysg+3c3pvKFWImNROi3ZRtWxiDb2EkeADDUrADloYqp0Yj9CkryJXAve9kiCJD+qR9qa M6rIkXpwfhRm8mpjAm5h6VpZ+8VacR7XD5JfWZOGL2+Ou4IcqEEDCHIx7CBHkeZIjjyY WXcg==
- 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
I understand that you can split a parameter value on a fixed string:
% print -l ${(s.1.):-a1b1c}
a
b
c
My reading of the ~ flag leads me to believe that you can replace the
literal string with a pattern, so that
% print -l ${(~s.[12].):-a1b2c}
a
b
c
However, the ~ flag seems to have no effect, with the parameter string
remaining unsplit.
--
Clint
Messages sorted by:
Reverse Date,
Date,
Thread,
Author