[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trailing newlines disappear
From: |
Pierre Gaston |
Subject: |
Re: Trailing newlines disappear |
Date: |
Fri, 9 Jun 2017 20:58:05 +0300 |
On Fri, Jun 9, 2017 at 8:40 PM, Peter & Kelly Passchier <
peterkelly@passchier.net> wrote:
> On 09/06/2560 23:38, L A Walsh wrote:
> > Chet Ramey wrote:
> >>
> >> Should mapfile silently drop the NULs?
> >
> > Maybe add a flag to ignore NUL bytes that could be used in the 'read'
> > statement as well? If not specified, keep same behavior?
>
> That sounds like it might be useful.
> It might be more desirable to change it to a newline instead of dropping
> it? (Or both, with different flags??)
>
I feel this kind of magic behavior would result in hackish scripts or fill
a somewhat rare niche at best.
I'd rather have bash to fully handle arrays of byte, or nothing.
> And how about a shell option to not omit trailing newlines in command
> substitutions?? I find that very undesirable and unnecessary behaviour.
>
> Peter
>
> I would argue that dropping the trailing newlines is what most use and
want.
Even if they don't realize it, few people would expect:
var=$(wc -l file);echo "$var"
to print 2 lines.
Trailing newlines are often not that interesting.
- Re: Trailing newlines disappear, (continued)
- Re: Trailing newlines disappear, Peter & Kelly Passchier, 2017/06/08
- Re: Trailing newlines disappear, Greg Wooledge, 2017/06/08
- Re: Trailing newlines disappear, Eduardo Bustamante, 2017/06/08
- Re: Trailing newlines disappear, Peter & Kelly Passchier, 2017/06/08
- Re: Trailing newlines disappear, Greg Wooledge, 2017/06/09
- Re: Trailing newlines disappear, Chet Ramey, 2017/06/09
- Re: Trailing newlines disappear, Greg Wooledge, 2017/06/09
- Re: Trailing newlines disappear, Chet Ramey, 2017/06/09
- Re: Trailing newlines disappear, L A Walsh, 2017/06/09
- Re: Trailing newlines disappear, Peter & Kelly Passchier, 2017/06/09
- Re: Trailing newlines disappear,
Pierre Gaston <=
- Re: Trailing newlines disappear, Greg Wooledge, 2017/06/09
- Storing NUL in variables, George, 2017/06/09
- Re: Storing NUL in variables, Pierre Gaston, 2017/06/10
- Re: Storing NUL in variables, George, 2017/06/11
- Re: Trailing newlines disappear, Chet Ramey, 2017/06/12
- Re: Trailing newlines disappear, Peter & Kelly Passchier, 2017/06/12
- Re: Trailing newlines disappear, Chet Ramey, 2017/06/13
- Re: Trailing newlines disappear, Peter & Kelly Passchier, 2017/06/13
- Re: Trailing newlines disappear, PePa, 2017/06/09