Re: PWD not made canonical on shell start

2017-05-29 Thread dualbus
On Wed, May 24, 2017 at 11:53:45AM -0400, Chet Ramey wrote: [...] > It was changed back in 2015 as the result of > > http://lists.gnu.org/archive/html/bug-bash/2015-09/msg00053.html After reading POSIX's [1] (section 2.5.3 "Shell Variables"), I noticed that bash may not be following the specifica

Re: read -e allows execution of commands (edit-and-execute-command) as the shell's process user

2017-05-29 Thread dualbus
On Mon, May 29, 2017 at 12:29:16AM -0400, George Caswell wrote: [...] > Bash's builtin function "read" has one simple job: read data, return > it to the caller. There shouldn't be anything in there about executing > commands. > > Why does read even need a function like this? Is it something that w

Re: {varname} redirection for a command or group leaves the file open

2017-05-29 Thread Chet Ramey
On 5/19/17 4:32 PM, tetsu...@scope-eye.net wrote: > > Well, that's disappointing. So there is no technical reason for > this behavior > > other than copying the behavior of ksh. BTW zsh does the right > thing and in the > > following scenario: > > > > ls -lh /proc/self/fd {fd}>/dev/null

Re: Builtin history -r does not work with named pipes (i.e. GNU readline's histfile.c read_history_range)

2017-05-29 Thread Chet Ramey
On 5/23/17 11:32 AM, Eduardo Bustamante wrote: > (I think this is a good problem for Pranav to tackle if you consider > this to be a bug, Chet). > > The problem is that fstat(2) will return an st_size of 0 if the file > is non-regular. I think that the easiest path here is to goto > `error_and_exi

Re: Builtin history -r does not work with named pipes (i.e. GNU readline's histfile.c read_history_range)

2017-05-29 Thread dualbus
On Mon, May 29, 2017 at 04:17:16PM -0400, Chet Ramey wrote: [...] > So the bug is that readline doesn't print an error message if the history > file isn't a regular file? Correct. Another problem is that the history builtin doesn't propagate back a meaningful return code indicating that there was

Re: Builtin history -r does not work with named pipes (i.e. GNU readline's histfile.c read_history_range)

2017-05-29 Thread Chet Ramey
On 5/29/17 4:40 PM, dualbus wrote: > On Mon, May 29, 2017 at 04:17:16PM -0400, Chet Ramey wrote: > [...] >> So the bug is that readline doesn't print an error message if the history >> file isn't a regular file? > > Correct. Another problem is that the history builtin doesn't propagate > back a me

Re: PWD not made canonical on shell start

2017-05-29 Thread Chet Ramey
On 5/29/17 12:22 PM, dualbus wrote: > Bash doesn't really do that. What bash does is: This isn't quite an accurate representation of the bash behavior. > > case 1) > > If PWD is passed through the environment, > and the value is an absolute pathname of the CWD, > then set PWD to the

Re: PWD not made canonical on shell start

2017-05-29 Thread dualbus
On Mon, May 29, 2017 at 06:25:06PM -0400, Chet Ramey wrote: [...] > If PWD appears in the environment, and it is an absolute pathname of the > CWD, set PWD to the canonicalized version of the environment value. The > canonicalized version removes . and .., makes sure that the length is > less than

Re: {varname} redirection for a command or group leaves the file open

2017-05-29 Thread George
On Mon, 2017-05-29 at 15:36 -0400, Chet Ramey wrote: > > > > >  > Well, that's disappointing. So there is no technical reason for > > this behavior  > >  > other than copying the behavior of ksh. BTW zsh does the right > > thing and in the  > >  > following scenario:  > >  >  > >  > ls -lh /proc/

Re: read -e allows execution of commands (edit-and-execute-command) as the shell's process user

2017-05-29 Thread George
On Mon, 2017-05-29 at 11:37 -0500, dualbus wrote: > On Mon, May 29, 2017 at 12:29:16AM -0400, George Caswell wrote: > [...] > > > > Bash's builtin function "read" has one simple job: read data, return > > it to the caller. There shouldn't be anything in there about executing > > commands. > > > >

Re: Builtin history -r does not work with named pipes (i.e. GNU readline's histfile.c read_history_range)

2017-05-29 Thread Pranav Deshpande
So I can't take up this one? Regards, Pranav On May 30, 2017 2:35 AM, "Chet Ramey" wrote: > On 5/29/17 4:40 PM, dualbus wrote: > > On Mon, May 29, 2017 at 04:17:16PM -0400, Chet Ramey wrote: > > [...] > >> So the bug is that readline doesn't print an error message if the > history > >> file isn