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

RE: PATCH: Re: FW: About word splitting in read (Zsh)



> >
> > But still. The docs are wrong (backslashes inside the string). Should
> > we change the code or the doc?
>
> This changes the docs.
>

And this tries to clarify it a bit more. The docs are IMHO still misleading -
at least, I get impression that consecuitive whitespaces between words are
eliminated. That is not the case:

bor@itsrm2% read foo
  bar   baz
bor@itsrm2% print %$foo%
%bar   baz%

But my english fails me here :-)

-andrej

Index: Doc/Zsh/builtins.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v
retrieving revision 1.15
diff -u -r1.15 builtins.yo
--- Doc/Zsh/builtins.yo 2000/08/03 11:34:01     1.15
+++ Doc/Zsh/builtins.yo 2000/08/03 12:40:13
@@ -752,7 +752,8 @@
 vindex(IFS, use of)
 item(tt(read) [ tt(-rzpqAclneEt) ] [ tt(-k) [ var(num) ] ] \
 [ tt(-u)var(n) ] [ var(name)[tt(?)var(prompt)] ] [ var(name) ...  ])(
-Read one line and break it into fields using the characters
+Read one line, strip leading and trailing whitespaces contained
+in tt($IFS) and break it into fields using the characters
 in tt($IFS) as separators, except as noted below.
 The first field is assigned to the first var(name), the second field
 to the second var(name), etc., with leftover



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