zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: Re: FW: About word splitting in read (Zsh)
@ 2000-08-03 14:40 Sven Wischnowsky
  2000-08-03 14:42 ` Andrej Borsenkow
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Wischnowsky @ 2000-08-03 14:40 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> ...
> 
> This happens only when "leftover fields [are] assigned to the last name."
> It's consistent with bash.  Ash preserves both the inter-field AND the
> trailing whitespace in that circumstance, which would lead me to guess
> that the original Bourne `read' doesn't strip trailing whitespace.

Just for the record: both the sh and the ksh on this box (True64
blahblah) and on Solaris strip them.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* RE: PATCH: Re: FW: About word splitting in read (Zsh)
  2000-08-03 14:40 PATCH: Re: FW: About word splitting in read (Zsh) Sven Wischnowsky
@ 2000-08-03 14:42 ` Andrej Borsenkow
  0 siblings, 0 replies; 5+ messages in thread
From: Andrej Borsenkow @ 2000-08-03 14:42 UTC (permalink / raw)
  To: zsh-workers

> 
> Bart Schaefer wrote:
> 
> > ...
> > 
> > This happens only when "leftover fields [are] assigned to the last name."
> > It's consistent with bash.  Ash preserves both the inter-field AND the
> > trailing whitespace in that circumstance, which would lead me to guess
> > that the original Bourne `read' doesn't strip trailing whitespace.
> 
> Just for the record: both the sh and the ksh on this box (True64
> blahblah) and on Solaris strip them.
> 

Same here.

-andrej


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

* Re: PATCH: Re: FW: About word splitting in read (Zsh)
  2000-08-03 12:44 ` Andrej Borsenkow
@ 2000-08-03 14:31   ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2000-08-03 14:31 UTC (permalink / raw)
  To: Andrej Borsenkow, zsh-workers

On Aug 3,  4:44pm, Andrej Borsenkow wrote:
} Subject: 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%

This happens only when "leftover fields [are] assigned to the last name."
It's consistent with bash.  Ash preserves both the inter-field AND the
trailing whitespace in that circumstance, which would lead me to guess
that the original Bourne `read' doesn't strip trailing whitespace.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* RE: PATCH: Re: FW: About word splitting in read (Zsh)
  2000-08-03 11:31 Sven Wischnowsky
@ 2000-08-03 12:44 ` Andrej Borsenkow
  2000-08-03 14:31   ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Andrej Borsenkow @ 2000-08-03 12:44 UTC (permalink / raw)
  To: zsh-workers

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


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

* PATCH: Re: FW: About word splitting in read (Zsh)
@ 2000-08-03 11:31 Sven Wischnowsky
  2000-08-03 12:44 ` Andrej Borsenkow
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Wischnowsky @ 2000-08-03 11:31 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> [... read builtin with -r option]
> 
> But still. The docs are wrong (backslashes inside the string). Should
> we change the code or the doc?

This changes the docs.

Bye
 Sven

Index: Doc/Zsh/builtins.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v
retrieving revision 1.14
diff -u -r1.14 builtins.yo
--- Doc/Zsh/builtins.yo	2000/06/26 15:36:57	1.14
+++ Doc/Zsh/builtins.yo	2000/08/03 11:30:48
@@ -761,7 +761,8 @@
 startitem()
 item(tt(-r))(
 Raw mode: a `tt(\)' at the end of a line does not signify line
-continuation.
+continuation and backslashes in the line don't quote the following
+character and are not removed.
 )
 item(tt(-q))(
 Read only one character from the terminal and set var(name) to

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~2000-08-03 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-03 14:40 PATCH: Re: FW: About word splitting in read (Zsh) Sven Wischnowsky
2000-08-03 14:42 ` Andrej Borsenkow
  -- strict thread matches above, loose matches on Subject: below --
2000-08-03 11:31 Sven Wischnowsky
2000-08-03 12:44 ` Andrej Borsenkow
2000-08-03 14:31   ` Bart Schaefer

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