read builtin doesnt save partial reads on timeout

2016-06-06 Thread George Schwab
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib
-D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4
-Wformat -Werror=format-security -Wall
uname output: Linux zod 4.5.3-x86_64-linode67 #3 SMP Tue May 10 10:22:44
EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.3
Patch Level: 11
Release Status: release

Description:
The read builtin does not appear to save partial reads to the
variable when a timeout has occured.
This is contrary to the documentation which states 'read saves any
partial input read into the specified variable'

https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html#Bash-Builtins
Perhaps this is just an error in the documentation. either way,
should be fixed, right?
A friend has tested this on 4.4.0(1)-rc2 as well.

Repeat-By:
read -N2 -t1 < <(printf x; sleep 2; printf y); echo "$REPLY"
or
{ read -t1 a; read b; } < <(printf x; sleep 2; printf y); echo
"<$a><$b>"


Re: PS1 \# doesn't take into account HISTIGNORE and HISTCONTROL

2016-06-06 Thread Carlos Morata

Hi,

Ok I got it, lesson learnt. :)

Thank for your time and cheers. :)

El 06/06/16 a las 04:13, Chet Ramey escribió:

On 6/2/16 2:43 PM, Carlos Morata wrote:

Hi,

I think you misunderstod me.
I'm really interested in working with relative command history expasions.
So I need to work with !-$((\#-cmdnumbertarget)), not with !$HISTCMD.

I figure it out pretty well already but I think this is a bug cause you
loose all the relative history expansions when you hit HISTCONTROL or
HISTIGNORE and that doesn't get well with the principle of least surprise.

I'm not sure I understand.  If you turn on options and variables that
affect which commands are saved in the command history and how they are
saved (or affect the history list when they are saved, like erasedups),
it seems reasonable to expect that to affect the history number.

If you want the history list to reflect exactly the commands you enter,
unset HISTCONTROL and HISTIGNORE.  That way you can use something like
"!-3" with more confidence.







$ < some_file some_command Tab expansion

2016-06-06 Thread Dan Jacobson
Tab expansion works for both parts of
$ some_command < some_file
but not the some_command of
$ < some_file some_command

BASH_VERSION='4.4.0(1)-rc1'