|
From: | Oğuz İsmail Uysal |
Subject: | Re: IFS field splitting doesn't conform with POSIX |
Date: | Thu, 30 Mar 2023 19:10:19 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 |
On 3/30/23 2:12 PM, Felipe Contreras wrote:
zsh is the only shell that generates an empty last field, no other shell exhibits this behavior.IFS=, str='foo,bar,,roo,' printf '"%s"\n' $str
Besides your link says:>The shell shall treat each character of the IFS as a delimiter and use the delimiters as *field >terminators* to split the results of parameter expansion, command substitution, and arithmetic >expansion into fields.
So the delimiters terminate fields, not separate them.
[Prev in Thread] | Current Thread | [Next in Thread] |