zsh-users
 help / color / mirror / code / Atom feed
* flag z won't cause forced joining?
@ 2012-10-19  8:03 Han Pingtian
  2012-10-19 15:38 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Han Pingtian @ 2012-10-19  8:03 UTC (permalink / raw)
  To: zsh-user

Hi,

I just found that it looks like the z flag won't cause "forced joining"
which stated in rules 10, like this:

%  typeset -a arr;arr[1]=foo;arr[2]=\'bar;arr[3]=baz\';print -l ${(z)arr}
foo
'bar
baz'
% typeset -a arr;arr[1]=foo;arr[2]=\'bar;arr[3]=baz\';print -l ${(z)"${arr}"}
foo
'bar baz'
%

Not sure is it a problem. Please help. Thanks in advance.


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

* Re: flag z won't cause forced joining?
  2012-10-19  8:03 flag z won't cause forced joining? Han Pingtian
@ 2012-10-19 15:38 ` Bart Schaefer
  2012-10-19 23:34   ` Han Pingtian
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2012-10-19 15:38 UTC (permalink / raw)
  To: zsh-user

On Oct 19,  4:03pm, Han Pingtian wrote:
}
} I just found that it looks like the z flag won't cause "forced joining"
} which stated in rules 10

Yes, this is a case of the documentation being wrong; it was recently
corrected.  Rule 10 now says:

10. _Forced joining_
     If the `(j)' flag is present, or no `(j)' flag is present but the
     string is to be split as given by rule 11., and joining did not
     take place at step 5., any words in the value are joined together
     using the given string or the first character of $IFS if none.
     Note that the `(F)' flag implicitly supplies a string for joining
     in this manner.

11. _Simple word splitting_
     If one of the `(s)' or `(f)' flags are present, or the `='
     specifier was present (e.g. ${=VAR}), the word is split on
     occurrences of the specified string, or (for = with neither of the
     two flags present) any of the characters in $IFS.

     If no `(s)', `(f)' or `=' was given, but the word is not quoted
     and the option SH_WORD_SPLIT is set, the word is split on
     occurrences of any of the characters in $IFS.  Note this step, too,
     takes place at all levels of a nested substitution.

Note that the reference to rule 17 [the (z) flag] has been removed from
rule 10 (and rule 11 is new).


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

* Re: flag z won't cause forced joining?
  2012-10-19 15:38 ` Bart Schaefer
@ 2012-10-19 23:34   ` Han Pingtian
  0 siblings, 0 replies; 3+ messages in thread
From: Han Pingtian @ 2012-10-19 23:34 UTC (permalink / raw)
  To: zsh-users

On Fri, Oct 19, 2012 at 08:38:18AM -0700, Bart Schaefer wrote:
> On Oct 19,  4:03pm, Han Pingtian wrote:
> }
> } I just found that it looks like the z flag won't cause "forced joining"
> } which stated in rules 10
> 
> Yes, this is a case of the documentation being wrong; it was recently
> corrected.  Rule 10 now says:
> 
> 10. _Forced joining_
>      If the `(j)' flag is present, or no `(j)' flag is present but the
>      string is to be split as given by rule 11., and joining did not
>      take place at step 5., any words in the value are joined together
>      using the given string or the first character of $IFS if none.
>      Note that the `(F)' flag implicitly supplies a string for joining
>      in this manner.
> 
> 11. _Simple word splitting_
>      If one of the `(s)' or `(f)' flags are present, or the `='
>      specifier was present (e.g. ${=VAR}), the word is split on
>      occurrences of the specified string, or (for = with neither of the
>      two flags present) any of the characters in $IFS.
> 
>      If no `(s)', `(f)' or `=' was given, but the word is not quoted
>      and the option SH_WORD_SPLIT is set, the word is split on
>      occurrences of any of the characters in $IFS.  Note this step, too,
>      takes place at all levels of a nested substitution.
> 
> Note that the reference to rule 17 [the (z) flag] has been removed from
> rule 10 (and rule 11 is new).

Thanks a lot.


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

end of thread, other threads:[~2012-10-19 23:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19  8:03 flag z won't cause forced joining? Han Pingtian
2012-10-19 15:38 ` Bart Schaefer
2012-10-19 23:34   ` Han Pingtian

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