Date:Sun, 12 Jan 2025 22:39:57 -0500
From:Greg Wooledge
Message-ID: <20250113033957.gc27...@wooledge.org>
| At the risk of going a bit off topic, may I ask *why* the shell does
| that? Were there any files or data stream conventions in common use
| in the 1970s
On Mon, Jan 13, 2025 at 08:42:39 +0700, Robert Elz wrote:
> It is unexpected, because users believe (from other experience)
> that the delimiters separate fields, but in sh they don't, they
> terminate fields.
At the risk of going a bit off topic, may I ask *why* the shell does
that? Were there a
Date:Sun, 12 Jan 2025 16:55:05 -0500
From:Greg Wooledge
Message-ID: <20250112215505.gb27...@wooledge.org>
| Right. You explained why it works the way it does. But from a user's
| point of view, it's just unexpected behavior.
It is unexpected, because users beli
Greg Wooledge wrote in
<20250112215505.gb27...@wooledge.org>:
|On Sun, Jan 12, 2025 at 16:26:04 -0500, Chet Ramey wrote:
|>> In this case, we get the "expected" result:
|>
|> You just restated the original example while ignoring the part of my
|> message about looking for additional input af
On 1/12/25 4:55 PM, Greg Wooledge wrote:
On Sun, Jan 12, 2025 at 16:26:04 -0500, Chet Ramey wrote:
In this case, we get the "expected" result:
You just restated the original example while ignoring the part of my
message about looking for additional input after you find a delimiter.
Right. Y
On Sun, Jan 12, 2025 at 16:26:04 -0500, Chet Ramey wrote:
> > In this case, we get the "expected" result:
>
> You just restated the original example while ignoring the part of my
> message about looking for additional input after you find a delimiter.
Right. You explained why it works the way it
On 1/12/25 4:19 PM, Greg Wooledge wrote:
On Sun, Jan 12, 2025 at 16:10:03 -0500, Chet Ramey wrote:
This is a combination of two rules: characters in IFS are field
terminators, not separators, and when `read' is supplied fewer
variables than fields,
"Any remaining input in the original field bei
On Sun, Jan 12, 2025, at 10:19 AM, MacBeth wrote:
> On Sun, Jan 12, 2025 at 8:58 AM MacBeth wrote:
>
>> And here is a version you would have to use without `sed` to get the line
>> first, before you can append the field terminator to it:
>>
>> delim=,
>> {
>> while IFS= read -r row; do
>>
On Sun, Jan 12, 2025 at 16:10:03 -0500, Chet Ramey wrote:
> This is a combination of two rules: characters in IFS are field
> terminators, not separators, and when `read' is supplied fewer
> variables than fields,
>
> "Any remaining input in the original field being processed shall be
> returned t
On 1/11/25 9:54 AM, MacBeth wrote:
Bash Version: 5.2
Patch Level: 37
Release Status: release
Description:
It seems that `read` truncates a trailing delimiter if there is one less
variable argument than input fields and the last field is empty (trailing
delimiter).
This is a combination of tw
On Sun, Jan 12, 2025 at 8:58 AM MacBeth wrote:
> On Sun, Jan 12, 2025 at 8:24 AM Félix Hauri wrote:
>
>> Le Sat, Jan 11, 2025 at 10:49:50AM -0500, Greg Wooledge a écrit :
>> > https://mywiki.wooledge.org/BashPitfalls#pf47
>> > "It's a feature."
>> >
>> -- how do we work around this nonsense?
>>
On Sun, Jan 12, 2025 at 8:24 AM Félix Hauri wrote:
> Le Sat, Jan 11, 2025 at 10:49:50AM -0500, Greg Wooledge a écrit :
> > https://mywiki.wooledge.org/BashPitfalls#pf47
> > "It's a feature."
> >
> -- how do we work around this nonsense?
>
> I've alredy noticed this, but never stictly tested them
Le Sat, Jan 11, 2025 at 10:49:50AM -0500, Greg Wooledge a écrit :
> https://mywiki.wooledge.org/BashPitfalls#pf47
> "It's a feature."
>
-- how do we work around this nonsense?
I've alredy noticed this, but never stictly tested them as:
for row in k{:v1{:v2{:{:{:,},},},:{:{:,},},},:{:{:,},},}
13 matches
Mail list logo