bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IFS field splitting doesn't conform with POSIX


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:
     IFS=,
     str='foo,bar,,roo,'
     printf '"%s"\n' $str
zsh is the only shell that generates an empty last field, no other shell exhibits this behavior.

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]