* RE: About word splitting in read
@ 2000-06-23 10:41 Sven Wischnowsky
0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 2000-06-23 10:41 UTC (permalink / raw)
To: zsh-workers
Andrej Borsenkow wrote:
> >
> > Errr... in what way does `read -r foo' not do what you want?
> >
>
> Sorry, I was (completely) wrong. The actual problem is not field
> splitting, but rather backslash elimination.
>
> About 'read -r' - manual states, it just does not treat final backslash
> as line continuation. Look:
>
> bor@itsrm2% read -r foo
> a b \
> bor@itsrm2% print $foo
> a b \
>
> but
>
> bor@itsrm2% read -r foo
> q\ g\ b
> bor@itsrm2% print $foo
> q g b
> bor@itsrm2% read -r foo
> q\ g\ b \
> bor@itsrm2% print $foo
> q g b \
>
> Hmm ... is it a bug?
Try `print -r $foo'.
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: About word splitting in read
@ 2000-06-23 10:22 Sven Wischnowsky
2000-06-23 10:37 ` Andrej Borsenkow
0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 2000-06-23 10:22 UTC (permalink / raw)
To: zsh-workers
Andrej Borsenkow wrote:
> The last patch reminded me ...
>
> Currently we can
>
> - either read in the whole line (with length unknown in advance) theat
> is IFS-splitted
> - or read in fixed number of raw characters
>
> Several times I wished, we could read in the whole line but in *raw*
> mode, that is, without any word splitting. It is somewhat hard to
> implement this, as we end up with too long/incomplete line so we need
> some sort of buffered IO on top of read etc
>
> How hard would be to add this to read? With semantic "read in the whole
> line and assign it to scalar unchanged".
Errr... in what way does `read -r foo' not do what you want?
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: About word splitting in read
2000-06-23 10:22 Sven Wischnowsky
@ 2000-06-23 10:37 ` Andrej Borsenkow
0 siblings, 0 replies; 4+ messages in thread
From: Andrej Borsenkow @ 2000-06-23 10:37 UTC (permalink / raw)
To: Sven Wischnowsky, zsh-workers
>
> Errr... in what way does `read -r foo' not do what you want?
>
Sorry, I was (completely) wrong. The actual problem is not field
splitting, but rather backslash elimination.
About 'read -r' - manual states, it just does not treat final backslash
as line continuation. Look:
bor@itsrm2% read -r foo
a b \
bor@itsrm2% print $foo
a b \
but
bor@itsrm2% read -r foo
q\ g\ b
bor@itsrm2% print $foo
q g b
bor@itsrm2% read -r foo
q\ g\ b \
bor@itsrm2% print $foo
q g b \
Hmm ... is it a bug?
-andrej
^ permalink raw reply [flat|nested] 4+ messages in thread
* About word splitting in read
@ 2000-06-23 10:16 Andrej Borsenkow
0 siblings, 0 replies; 4+ messages in thread
From: Andrej Borsenkow @ 2000-06-23 10:16 UTC (permalink / raw)
To: ZSH workers mailing list
The last patch reminded me ...
Currently we can
- either read in the whole line (with length unknown in advance) theat
is IFS-splitted
- or read in fixed number of raw characters
Several times I wished, we could read in the whole line but in *raw*
mode, that is, without any word splitting. It is somewhat hard to
implement this, as we end up with too long/incomplete line so we need
some sort of buffered IO on top of read etc
How hard would be to add this to read? With semantic "read in the whole
line and assign it to scalar unchanged".
-andrej
Have a nice DOS!
B >>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-06-23 10:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-23 10:41 About word splitting in read Sven Wischnowsky
-- strict thread matches above, loose matches on Subject: below --
2000-06-23 10:22 Sven Wischnowsky
2000-06-23 10:37 ` Andrej Borsenkow
2000-06-23 10:16 Andrej Borsenkow
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).