zsh-users
 help / color / mirror / code / Atom feed
* cat file|while read behaves not as expected
@ 2002-09-16  6:32 Micha Holzmann
  2002-09-16  6:52 ` Paul Lew
  0 siblings, 1 reply; 3+ messages in thread
From: Micha Holzmann @ 2002-09-16  6:32 UTC (permalink / raw)
  To: zsh-users

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

Hello,

i am new with zsh. I recently switched from bash to zsh. Now i stuck in
a little problem.

I use a file as configuration for a script. I read this file via cat and pipe
the result to while read...

The file content (example) is:

>---  cut here  ----
1 2 3 4 5
>---  cut here  ----

My script (a fragment from):

>---  cut here  ----
#!/bin/zsh

 cat ./tst.dat|while read line
 do
   for i in $line
     do
       echo $i
     done
 done
>---  cut here  ----


If i run this script, it prints "1 2 3 4 5" as result, if i change the
shell to /bin/sh, it prints (te expected) result:

1
2
3
4
5

What is the fault i make?

Thanks in advance for any respones,
kind regards,
Micha Holzmann

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2002-09-16  7:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-16  6:32 cat file|while read behaves not as expected Micha Holzmann
2002-09-16  6:52 ` Paul Lew
2002-09-16  7:45   ` Micha Holzmann

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).