Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh Guide chapter 5 (substitutions)
- X-seq: zsh-users 4133
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: Zsh Guide chapter 5 (substitutions)
- Date: Fri, 17 Aug 2001 16:55:50 +0000
- In-reply-to: <20010815230024.3E7F614284@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20010815230024.3E7F614284@xxxxxxxxxxxxxxxxxxxxxxxx>
On Aug 16, 12:00am, Peter Stephenson wrote:
}
} The main addition is chapter 5, which talks about all forms of shell
} substitutions and expansions.
Asoorted comments:
The only thing you can't quote with single quotes is another single
quote. However, there's an option RC_QUOTES, in which RC presumably
stands for recursive,
Nope, RC stands for RC. The Plan 9 shell (I think it is) is named "rc",
and nearly everything in zsh that has "rc" at the beginning of the name
(as opposed to at the end) means that the feature was copied from the
Plan 9 shell. (At the end, as in ".zshrc", "runtime configuration" is
the meaning usually reported in Unix lore.)
% args "${(f)$(<file)}"
2
I don't remember what the `f' stands for, but we were already using up
flag codes quite fast when it came along.
I think it's for "fold", although it was added at a time when I was
paying less attention to zsh development. At least that's a plausible
mnemonic.
All the assignment types are affected by the globbing flags `A' and
`AA' which tell the shell to perform array and associative array
assignment ...
Should not say "globbing flags".
Note you need the colon, else you are asking the shell to test whether
a parameter is set, and it becomes rather unset when it realises there
isn't one to test. ^^^^^
I should think.
4. Now we have `${array[(r)???????]}'. It may not be obvious
(congratulations if the rest is), but the question marks are still
active as a pattern: the fill-in operation that put them there
didn't turn them into strings, because that only happens at the
point where a parameter is substituted, whereas these were added
later. The subscript flag `(r)' means `reverse match', ...
You're both right and wrong there. It actually doesn't matter whether
the question marks are still active as a pattern or not. Just go round
mumbling `extra layer of pattern expansion' and everyone will think you
know what you're talking about.
I have to stop now and go do this annoying "work" thing. Back to part
5.6 later.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author