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

Re: Looking for clarity of the word/term "string" as used in a couple of places in man pages



On Sat, Jun 25, 2022, at 9:14 PM, Jim wrote:
> The CONDITIONAL EXPRESSIONS '-n string' and '-z string' both allow 
> 'string' to be
> either a literal string(quoted or not) or a parameter.
>
> Parameter Expansion Flags 'r' and 'l' for 'string1' and 'string2' 
> appear only to allow literal
> strings. And, quotes are considered part of said string.  The only 
> special character that
> I found that works, so far, is a backslash(\).
>
> Is this an inconsistent use of the term string, or am I missing something?

What you're missing is that conditional expressions' "file", "string",
and "pattern" arguments are documented to undergo shell expansions,
while the arguments of most parameter expansion flags are not.

"String" is not a rigorously defined term, so it's not all that
useful to get hung up on what it "means".

-- 
vq




Messages sorted by: Reverse Date, Date, Thread, Author