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

Re: permission denied

On 2023-04-20 20:12, Bart Schaefer wrote:

Because that's not all it does.  The first part of the sentence --
"Split the result of the expansion into words using shell parsing" --
is the important bit.  (The "i.e." in "i.e. taking" should probably be
an "e.g." as it is only one example of what happens.)
 Yeah, it makes it look like that's the entire point.
$=x only splits on spaces.  (z) gives you a separate word for each
shell token

See, now that's entirely clear and instantly understandable. Especially by juxtaposing the two,  one is left in no doubt. Formal knowledge becomes practical knowledge.

, so e.g. "<file" becomes the two words "<" and "file", and
"echo foo;" becomes 3 words "echo", "foo", and ";", and so on.

But:     "echo foo"     remains one word because it's quoted! Yes?

Anyway, as always a few simple examples make it understandable.

BTW, this hardly matters in practice but:

4 /aWorking/Zsh/Source/Wk 0 % print -rl "Hello World"
Hello World

4 /aWorking/Zsh/Source/Wk 0 % $chain1
"Hello World"

... can the quotes be omitted from the output?  I tried: " chain0=( ${(Qz)1} )  "  but then it broke into two words again. Not important but if it can be done I'll take it.

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