zsh-users
 help / color / mirror / code / Atom feed
* possible bug in zsh concerning a for loop
@ 2022-03-18  7:33 Leander Jedamus
  2022-03-18  8:45 ` Jun T
  0 siblings, 1 reply; 5+ messages in thread
From: Leander Jedamus @ 2022-03-18  7:33 UTC (permalink / raw)
  To: Zsh Users

Hi!

I tried to get a normal for loop to work with zsh. Now I think I found a 
bug.

A short script is
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<
#!/bin/zsh

items="item1 item2 item3"

for i in $items; do
   echo "\"$i\""
done
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<

This prints:
"item1 item2 item3"

It should print:
"item1"
"item2"
"item3"

I hope that somebody can verify this.

Thanks in advance
Leander Jedamus
-- 
.o.
_^_ Ich bin nicht das Problem. Ich bin die Lösung.


^ permalink raw reply	[flat|nested] 5+ messages in thread
* possible bug in zsh concerning a for loop
@ 2022-03-18  8:21 Leander Jedamus
  0 siblings, 0 replies; 5+ messages in thread
From: Leander Jedamus @ 2022-03-18  8:21 UTC (permalink / raw)
  To: Zsh Users

Hi!

I tried to get a normal for loop to work with zsh. Now I think I found a
bug (zsh is 5.7.1).

A short script is
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<
#!/bin/zsh

items="item1 item2 item3"

for i in $items; do
   echo "\"$i\""
done
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<

This prints:
"item1 item2 item3"

It should print:
"item1"
"item2"
"item3"

I hope that somebody can verify this.

Thanks in advance
Leander Jedamus
--
.o.
_^_ Ich bin nicht das Problem. Ich bin die Lösung.


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: possible bug in zsh concerning a for loop
@ 2022-03-18 10:12 Leander Jedamus
  0 siblings, 0 replies; 5+ messages in thread
From: Leander Jedamus @ 2022-03-18 10:12 UTC (permalink / raw)
  To: Zsh Users

Thanks Jun T.
${=items} solved it for me. When I used to set the setopt-variable, it
just messed my system...

Thanks
Leander Jedamus
--
.o.
_^_ Ich bin nicht das Problem. Ich bin die Lösung.


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

end of thread, other threads:[~2022-03-18 14:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18  7:33 possible bug in zsh concerning a for loop Leander Jedamus
2022-03-18  8:45 ` Jun T
2022-03-18 14:14   ` Vincent Lefevre
2022-03-18  8:21 Leander Jedamus
2022-03-18 10:12 Leander Jedamus

Code repositories for project(s) associated with this public 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).