zsh-users
 help / color / mirror / code / Atom feed
* Looking for clarity of the word/term "string" as used in a couple of places in man pages
@ 2022-06-26  1:14 Jim
  2022-06-26  4:35 ` Lawrence Velázquez
  0 siblings, 1 reply; 2+ messages in thread
From: Jim @ 2022-06-26  1:14 UTC (permalink / raw)
  To: zsh

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

Hi everyone,

I hope I am not reading more into this than was the original intent.

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?

I was hoping to use a parameter as 'string?' to generate padding, but ended
up using a
loop instead.

Is there any reason why a parameter wouldn't work other than the code not
supporting it?

Thanks,

Jim Murphy

[-- Attachment #2: Type: text/html, Size: 1081 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Looking for clarity of the word/term "string" as used in a couple of places in man pages
  2022-06-26  1:14 Looking for clarity of the word/term "string" as used in a couple of places in man pages Jim
@ 2022-06-26  4:35 ` Lawrence Velázquez
  0 siblings, 0 replies; 2+ messages in thread
From: Lawrence Velázquez @ 2022-06-26  4:35 UTC (permalink / raw)
  To: linuxtechguy; +Cc: zsh-users

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-26  4:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-26  1:14 Looking for clarity of the word/term "string" as used in a couple of places in man pages Jim
2022-06-26  4:35 ` Lawrence Velázquez

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).