Re: Default time for unmarked history lines

2016-01-18 Thread Reuben Thomas
On 11 January 2016 at 14:22, Chet Ramey wrote: > For a history file without any timestamps, using > the current default and setting the history entry timestamp to the current > time is more appropriate. > ​Why is that? The only similar thing I can think of is file systems, where if you zero the

Re: read Built-in Parameter Behavior -- Null Byte Delimiter

2016-01-18 Thread Greg Wooledge
On Sat, Jan 16, 2016 at 02:28:27PM -0500, Adam Danischewski wrote: > If it is expected behavior I didn't see it in the documents. I suspect the interpretation of -d '' to mean a NUL byte delimiter may have been an accident originally (but that's a guess). But it's an incredibly useful feature, an

Re: read Built-in Parameter Behavior -- Null Byte Delimiter

2016-01-18 Thread Chet Ramey
On 1/18/16 8:14 AM, Greg Wooledge wrote: > On Sat, Jan 16, 2016 at 02:28:27PM -0500, Adam Danischewski wrote: >> If it is expected behavior I didn't see it in the documents. > > I suspect the interpretation of -d '' to mean a NUL byte delimiter > may have been an accident originally (but that's a

Fwd: Re: Default time for unmarked history lines

2016-01-18 Thread Chet Ramey
--- Begin Message --- On 1/11/16 11:54 AM, Reuben Thomas wrote: > On 11 January 2016 at 14:22, Chet Ramey > wrote: > > For a history file without any timestamps, using > the current default and setting the history entry timestamp to the current > time is mo

Re: read Built-in Parameter Behavior -- Null Byte Delimiter

2016-01-18 Thread Greg Wooledge
On Mon, Jan 18, 2016 at 11:16:06AM -0500, Chet Ramey wrote: > On 1/18/16 8:14 AM, Greg Wooledge wrote: > > I suspect the interpretation of -d '' to mean a NUL byte delimiter > > may have been an accident originally (but that's a guess). > > I guess that depends on what you mean by `accident'. Hap

Fwd: Default time for unmarked history lines

2016-01-18 Thread Reuben Thomas
[ ​Forwarding reply erroneously not sent to the list.]​ On 15 January 2016 at 15:26, Chet Ramey wrote: > On 1/11/16 11:54 AM, Reuben Thomas wrote: > > On 11 January 2016 at 14:22, Chet Ramey > > wrote: > > > > For a history file without any timestamps, using > >

Re: read Built-in Parameter Behavior -- Null Byte Delimiter

2016-01-18 Thread Chet Ramey
On 1/18/16 11:25 AM, Greg Wooledge wrote: > On Mon, Jan 18, 2016 at 11:16:06AM -0500, Chet Ramey wrote: >> On 1/18/16 8:14 AM, Greg Wooledge wrote: >>> I suspect the interpretation of -d '' to mean a NUL byte delimiter >>> may have been an accident originally (but that's a guess). >> >> I guess tha

Re: read Built-in Parameter Behavior -- Null Byte Delimiter

2016-01-18 Thread Stephane Chazelas
2016-01-18 11:16:06 -0500, Chet Ramey: [...] > > But it's > > an incredibly useful feature, and has been used in countless real > > life scripts. At this point, while it is still undocumented, it is > > nevertheless a feature whose omission would be considered a regression. > > It's not a special

Re: read Built-in Parameter Behavior -- Null Byte Delimiter

2016-01-18 Thread Stephane Chazelas
2016-01-18 11:25:49 -0500, Greg Wooledge: [...] > Other shells must go out of their way to suppress it, then. > > wooledg@wooledg:~$ while IFS= read -r -d '' foo; do echo "<$foo>"; done < > <(printf 'one\0two\0') > > > wooledg@wooledg:~$ ksh > $ while IFS= read -r -d '' foo; do echo "<$foo>"; d

Re: Fwd: Default time for unmarked history lines

2016-01-18 Thread Chet Ramey
On 1/18/16 11:53 AM, Reuben Thomas wrote: > So, how about instead interpreting a missing/0 date as a NaD (Not A Date), > rather as readline does anyway with time 0, and providing a slightly more > meaningful message than the current "??". Then a) I would be able to remove > all my bogus "1" timest