Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Parameter subsitution
- X-seq: zsh-users 26352
- From: Lewis Butler <lbutler@xxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Parameter subsitution
- Date: Fri, 8 Jan 2021 15:02:17 -0700
- Archived-at: <https://zsh.org/users/26352>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/6B1D00CF-E282-49D3-8ABE-88AB8EBED62B%40covisp.net>
- List-id: <zsh-users.zsh.org>
Reading through the docs:
The s/l/r/ substitution works as follows.
[. . . ]
* A null l uses the previous string either from the previous l or from the contextual scan string s from ‘!?s’.
And
* Note the same record of the last l and r is maintained across all forms of expansion.
Does this mean that l is recorded until the shell terminates or until a new l is used? Is there a way to see what the current l is set to?
$ file="/usr/local/tmp/filename.txt"
$ echo ${file:s|e|3}
/usr/local/tmp/fil3name.txt
$ echo ${file:s||4}
/usr/local/tmp/filename.txt
Doesn't look like the l is maintained?
And where is the !?s syntax defined?
Any examples of using !?s in anger?
--
ɹןʇnqן
<mailto:lbutler@xxxxxxxxxx>
tel:+1.303.219.0564
Messages sorted by:
Reverse Date,
Date,
Thread,
Author