[Top][All Lists]

[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 20:48:05 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 3/30/23 7:51 PM, Felipe Contreras wrote:
So? This is argumentum ad populum. The fact that most shells do X doesn't imply that POSIX says X.
POSIX documents existing practice. If what it says differs from what the majority of shells do, then it's POSIX that is wrong. And this mailing list is not the right place to complain about it.

Yes. 'foo,bar,' has two terminators, and therefore two fields. 'foo,bar,roo' has two terminators and therefore two fields, plus garbage. You want to interpret 'foo' as a field, even though it does not have an an explicit terminator. But that's not specified anywhere in POSIX. POSIX doesn't say what should be done with the text after the last terminator. You could throw it away and still be conforming to POSIX.
I don't think *to SPLIT using delimiters as field terminators* involves leaving any part out.

reply via email to

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