Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [doc] "sh_word_split nothing to do with word splitting"?
- X-seq: zsh-workers 42448
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: [doc] "sh_word_split nothing to do with word splitting"?
- Date: Sun, 11 Mar 2018 20:53:48 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PmonZFIKVMDR6gCTwsNfAbn/LnOZ91k5A7mKFGolpqA=; b=iw5+y7lu4w8EZFheZlAALXLuBG42sApWAlRfeETcI3lee7hfRRo8Ps8e5x8UwiXxwa BG6HNmBMZbEUC8tVBNmVO5RP0XCYMg9P8Uwg6qcB7TgwamOI9fR6caCRaZ3bQz/qF9c3 4PdVtLYZbhHh+q7/cq/Kc5qBvm+dmePOa6bTMpr8vZj985eRTH37YkzYsUUFchpMdWHG /tDc6gALVIVTGjnZBf+GFUHMe8tjyzcRUnDexN/hg8qw4GW6DKvbenbSg2tYYAf0+njQ Ij3yTZY79/uvDZlhu29B+PXp6eui0h7ulOjujKPIPHbEDQNKT1/OClAnUHrxsWmHqGzL 0qrA==
- In-reply-to: <180311112407.ZM2303@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180311094458.GA6450@chaz.gmail.com> <180311112407.ZM2303@torch.brasslantern.com>
2018-03-11 11:24:07 -0700, Bart Schaefer:
> On Mar 11, 9:44am, Stephane Chazelas wrote:
> } Subject: [doc] "sh_word_split nothing to do with word splitting"?
> }
> } SH_WORD_SPLIT (-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 *note Parameter Expansion::.)
>
> What this means to say:
>
> This option applies to field splitting within an expanded shell word,
> not to splitting a command line into shell words during parsing.
Thanks Bart for confirming that.
What about changing it to something like:
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 25b3d57..7677f73 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -2314,9 +2314,17 @@ 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 and contrary to the Bourne shell, not on words
+that are not the result of 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 anonymous functions,
+array assignments and for loop word lists. If the tt(MULTIOS) option is
+enabled, it is also performed in the targets of tt(<), tt(>) and tt(>>)
+redirection operators. (See noderef(Parameter Expansion) and
+noderef(Redirection)).
)
pindex(TRAPS_ASYNC)
pindex(NO_TRAPS_ASYNC)
A reference to $IFS may also be useful. Is it possible to add
references to index entries in yodl?
(I only include the >, >>, < redirections, that's missing the
clobber variants and the >& >>&... Not sure how to express it
without making it too wordy).
Not sure it's worth mentioning:
$var() function-definition
as a context where shwordsplit happens.
See also https://unix.stackexchange.com/a/382914
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author