Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Parameter subsitution



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