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

Re: [doc] "sh_word_split nothing to do with word splitting"?



So, how about this new take at it? Renders (in info) as:

SH_WORD_SPLIT (-y) <K> <S>
     Causes $IFS field splitting to be performed on unquoted parameter
     expansions in addition to command substitutions.  Note that
     contrary to POSIX shells, field splitting is still not performed on
     unquoted arithmetic expansions.  Like in other Bourne-like shells,
     field splitting is only performed in contexts where several words
     may be expected, such as in arguments to simple commands or inline
     functions, array assignments and for loop word lists.  If the
     MULTIOS option is enabled, it is also performed in the targets of
     file redirections (except for the read+write ones).  (See *note
     Parameter Expansion:: and *note Redirection::).

diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 25b3d57..97782de 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -2314,9 +2314,16 @@ pindex(NOSHWORDSPLIT)
 cindex(field splitting, sh style)
 cindex(sh, field splitting style)
 item(tt(SH_WORD_SPLIT) (tt(-y)) <K> <S>)(
-Causes field splitting to be performed on unquoted parameter expansions.
-Note that this option has nothing to do with word splitting.
-(See noderef(Parameter Expansion).)
+Causes tt($IFS) field splitting to be performed on unquoted parameter
+expansions in addition to command substitutions. Note that contrary to
+POSIX shells, field splitting is still not performed on unquoted
+arithmetic expansions. Like in other Bourne-like shells, field splitting
+is only performed in contexts where several words may be expected, such
+as in arguments to simple commands or inline functions, array
+assignments and for loop word lists. If the tt(MULTIOS) option is
+enabled, it is also performed in the targets of file redirections
+(except for the read+write ones). (See noderef(Parameter Expansion) and
+noderef(Redirection)).
 )
 pindex(TRAPS_ASYNC)
 pindex(NO_TRAPS_ASYNC)



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