printf %q doesn't quote blanks other than space and tab

2016-06-02 Thread Stephane Chazelas
bash treats all blank characters in the locale (except multibyte ones, bug reported earlier) as token delimiters. Yet printf %q only quotes space and tab, not the other ones. For instance, on Solaris in locales using the iso8859-1 character set, 0xa0 (non-breaking space) is a single-byte blank ch

Re: RFC: Enabling or disabling tracing shell functions

2016-06-02 Thread Dan Douglas
Not sure exactly how zsh does it but I know not having the option for both global and local tracing can be annoying. The two big ways of handling xtrace I mostly see are either bash's global `set -x` or ksh93's per-function tracing, and it can be annoying to be missing either one. There are tricks

Re: {ref}<&- does not work on array reference subscripts

2016-06-02 Thread Grisha Levit
I was thinking maybe some {get,set,unbind}_var_or_array_elem functions would help since there are a number of places that all need to handle this consistently. Could catch the case of using subscripts on array-reference-namerefs in such a function as well.

Re: mapfile creates poorly-named array if passed nameref to array subscript

2016-06-02 Thread Chet Ramey
On 6/1/16 6:19 PM, Grisha Levit wrote: > |$ declare -n ref=XXX[0]; mapfile ref <<< $'1\n2'; declare -p XXX[0] declare > -a XXX[0]=([0]=$'1\n' [1]=$'2\n') | > > maybe makes sense to check for legal identifier before making the array? Actually, it makes sense to check only for legal identifier inst

Re: Mulit-line aliases and PROMPT_COMMAND

2016-06-02 Thread Dan Douglas
On Thu, Jun 2, 2016 at 7:18 PM, Grisha Levit wrote: > > On Thu, Jun 2, 2016 at 6:57 PM, Chet Ramey wrote: >> >> > Since bash 4.3 multi-line aliases interact very strangely >> >> And you're the first person to report them. I guess there aren't a lot of >> multi-line aliases out there. > > > I won

Re: declare checks on valid nameref names don't account for +=

2016-06-02 Thread Chet Ramey
On 6/2/16 3:46 AM, Grisha Levit wrote: > Maybe this is fixed now, but the latest devel went a little overboard :) > > $ declare a=a > bash: a: nameref variable self references not allowed Good catch; thanks for the report. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: {ref}<&- does not work on array reference subscripts

2016-06-02 Thread Chet Ramey
On 6/1/16 6:44 PM, Grisha Levit wrote: > Yikes, I missed the |exec| command in my example, that would certainly make > it confusing.. > > What I meant was that the assignment works (i.e. the nameref is followed > correctly), but the relevant code >

Re: Mulit-line aliases and PROMPT_COMMAND

2016-06-02 Thread Grisha Levit
On Thu, Jun 2, 2016 at 6:57 PM, Chet Ramey wrote: > > Since bash 4.3 multi-line aliases interact very strangely > > And you're the first person to report them. I guess there aren't a lot > of multi-line aliases out there. > I wonder if more crazy use cases will come out of the woodwork when RHE

Re: nameref/subscript fixes for unset builtin

2016-06-02 Thread Chet Ramey
On 5/31/16 11:40 PM, Grisha Levit wrote: > The patch below addresses the following three issues: Thanks for the report and patch. At some point, I might make `unset -n n[0]' work the same as `unset -n n'. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ar

Re: Mulit-line aliases and PROMPT_COMMAND

2016-06-02 Thread Chet Ramey
On 4/20/16 4:41 PM, Grisha Levit wrote: > Since bash 4.3 multi-line aliases interact very strangely, especially in > connection with PROMPT_COMMAND. And you're the first person to report them. I guess there aren't a lot of multi-line aliases out there. > 1. PROMPT_COMMAND is executed after ever

Re: bash: Please make bash build reproducibly

2016-06-02 Thread Ximin Luo
CC'ing everyone that was on the previous conversation; Debian's BTS doesn't do this automatically :( We've made some progress on the Debian side; there's a few more stumbling blocks though: On Sat, 28 May 2016 13:38:35 +0200 Reiner Herrmann wrote: > Hi, > > it looks like most of the documenta

Re: readline doesn't refresh properly anymore

2016-06-02 Thread Dennis Williamson
On Jun 2, 2016 11:25 AM, "Charles T. Smith" wrote: > > Hello, > > I moved from ubuntu 10.04 to 14.04 and now readline usually doesn't refresh > my command line when scrolling through my history - the last tokens are often > not shown until I move the cursor there. Is that due to a change in bash?

Re: readline doesn't refresh properly anymore

2016-06-02 Thread Chet Ramey
On 4/8/16 11:22 AM, Charles T. Smith wrote: > Hello, > > I moved from ubuntu 10.04 to 14.04 and now readline usually doesn't refresh > my command line when scrolling through my history - the last tokens are often > not shown until I move the cursor there. Is that due to a change in bash? There's

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

2016-06-02 Thread Carlos Morata
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

Re: Bash crash bug

2016-06-02 Thread Chet Ramey
On 6/2/16 2:25 AM, konsolebox wrote: > On Thu, Jun 2, 2016 at 1:12 PM, Matthias Zimmerman > wrote: >> a better example is >> cat <(su) | cat >> cat <([a very simple program that will block io]) | (any thing else) $ cat <(sudo cat) | cat [sudo] password for chet: ^C $ cat <(sudo cat) | cat ^C $ ec

Re: a == a[0] convention

2016-06-02 Thread Grisha Levit
I think all of the stuff here is fixed in the latest devel snapshot, though there is definitely weirdness if you run the assignments as a typeset command. I hadn't even tried the ref4 case, which gives the weirdest results when used with typeset/declare: https://groups.google.com/forum/#!topic/gnu

Re: suspect nobody noticed these don't work ...

2016-06-02 Thread Greg Wooledge
On Fri, Apr 08, 2016 at 09:26:47AM -, Charles T. Smith wrote: > Does anybody know how to use ?(pattern)? Or @(pattern)? Or any of them > except !(pattern)? If you do an internet search, the man page is always > blithely quoted, but only !(pattern) is ever demostrated... > I wonder if the oth

Re: completion-prefix-display-length doesn't check for common prefix

2016-06-02 Thread Grisha Levit
Looks like a bunch of stuff posted to the google group just came through. This is a dupe. On Wed, Apr 20, 2016 at 5:39 PM, Grisha Levit wrote: > f() { COMPREPLY=(aa bb cc); } > complete -F f f > bind 'set completion-prefix-display-length 2' > > $ f [TAB][

edit-and-execute-command, history and PS1

2016-06-02 Thread Jure Oder
Dear all, I have noticed strange behaviour if my PS1 variable contains "the history number of this command" (\!). When the prompt returns after invoking the edit-and-execute-command (C-xC-e) the history number is not increased. If I then press return, the history number is increased by two (or mor

completion-prefix-display-length doesn't check for common prefix

2016-06-02 Thread Grisha Levit
f() { COMPREPLY=(aa bb cc); } complete -F f f bind 'set completion-prefix-display-length 2' $ f [TAB][TAB] ...aa ...bb ...cc None of the completion entries share a common prefix, though the docs suggest that only common prefixes

Mulit-line aliases and PROMPT_COMMAND

2016-06-02 Thread Grisha Levit
Since bash 4.3 multi-line aliases interact very strangely, especially in connection with PROMPT_COMMAND. 1. PROMPT_COMMAND is executed after every line in the alias, rather than just before the prompt is drawn: alias a=$'echo 1\necho2' PROMPT_COMMAND='echo $HOSTNAME' $ a 1 home 2 home $ 2. I

itrace() in jobs.c set_maxchild() w/o -DDEBUG

2016-06-02 Thread Grisha Levit
diff --git a/jobs.c b/jobs.c index b6c2506..c612b3a 100644 --- a/jobs.c +++ b/jobs.c @@ -4678,9 +4678,9 @@ set_maxchild (nchild) int nchild; { static int lmaxchild = -1; - +#ifdef DEBUG itrace("set_maxchild (%d)", nchild); - +#endif if (lmaxchild < 0) lmaxchild = getmaxchild ();

suspect nobody noticed these don't work ...

2016-06-02 Thread Charles T. Smith
Does anybody know how to use ?(pattern)? Or @(pattern)? Or any of them except !(pattern)? If you do an internet search, the man page is always blithely quoted, but only !(pattern) is ever demostrated... I wonder if the others even work? ?(pattern-list) Matches

readline doesn't refresh properly anymore

2016-06-02 Thread Charles T. Smith
Hello, I moved from ubuntu 10.04 to 14.04 and now readline usually doesn't refresh my command line when scrolling through my history - the last tokens are often not shown until I move the cursor there. Is that due to a change in bash? TIA, cts

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

2016-06-02 Thread Chet Ramey
On 6/2/16 6:38 AM, Carlos Morata wrote: > Hi, > > I'm using Fedora 22 and 4.3.42(1)-release. > The issue is that \# prompt variable doesn't take into account the value of > HISTIGNORE and HISTCONTROL. It's not supposed to. The `command number' is a count of the commands entered during the curre

RFC: Enabling or disabling tracing shell functions

2016-06-02 Thread Paulo César Pereira de Andrade
Hi, This is a "RFC" to update documentation to better match behavior, or, to get some information about shell tracing. Bellow I am quoting a request from an user: ---8<--- The bash shell offers the xtrace (set -x), functrace (set -T) and function trace (typeset -ft) facilities to control s

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

2016-06-02 Thread Carlos Morata
Hi, I'm using Fedora 22 and 4.3.42(1)-release. The issue is that \# prompt variable doesn't take into account the value of HISTIGNORE and HISTCONTROL. Steps to reproduce (* when wrong) == $bash --norc bash-4.3$ PS1="C:\#>" C:2>HISTIGNORE="history *" C:3>HISTCONTROL=ignoredups C:4>

declare ref[x] segfault and garbage values

2016-06-02 Thread Grisha Levit
These are maybe similar to the less-interesting issue of namerefs pointing to array subscripts, but are triggered by relatively normal assignments: -- This one is really strange: declare -n re=xxdeclare re[4]=78901234567890123456789012echo ${!re*} Segmentation fault:

Re: declare checks on valid nameref names don't account for +=

2016-06-02 Thread Grisha Levit
Maybe this is fixed now, but the latest devel went a little overboard :) $ declare a=a bash: a: nameref variable self references not allowed On Wed, Jun 1, 2016 at 9:45 AM, Chet Ramey wrote: > On 5/31/16 2:08 PM, Grisha Levit wrote: > > On Wed, May 25, 2016 at 3:29 PM, Chet Ramey >