Re: process substitution flawed by design

2017-02-20 Thread Greg Wooledge
On Mon, Feb 20, 2017 at 11:25:22PM +0100, Florian Mayer wrote: > echo foo | tee >(echo $$) >(echo $$) >/dev/null | cat > > returns the same PID twice. $$ is the PID of the main shell. I think what you want is the PID of each subshell, $BASHPID. imadev:~$ cat <(echo $$) <(echo $$) 3751 3751 imad

process substitution flawed by design

2017-02-20 Thread Florian Mayer
echo foo | tee >(echo $$) >(echo $$) >/dev/null | cat returns the same PID twice. I'm using the version 4.4.11. Why is there only one process for all the expansions? Why wasn't that documented? I think the only right way to do multiple process expansions in one command is by actually _starting o

Re: weird error due to cntrl-c out of history list

2017-02-20 Thread L A Walsh
Chet Ramey wrote: On 2/20/17 12:40 AM, L A Walsh wrote: In both 4.3.42(2)-release and 4.4.5(1)-release, I was listing my history (history cmd) and hit control-C and got: Do you have SIGINT trapped? nope: trap trap -- '' SIGTSTP trap -- '' SIGTTIN trap -- '' SIGTTOU trap -- 'sh

Re: Hang in bgp_delete

2017-02-20 Thread Chet Ramey
On 2/19/17 10:41 PM, Graham Northup wrote: > > I have some bad news for you: the fix works for one-cycles, but I just > found a three-cycle during this entertaining conversation with GDB: Loop detection is pretty easy. I'm more interested in where the loop is being introduced. I suspect bgp_de

Re: weird error due to cntrl-c out of history list

2017-02-20 Thread Chet Ramey
On 2/20/17 12:40 AM, L A Walsh wrote: > In both 4.3.42(2)-release and > 4.4.5(1)-release, I was listing my history (history cmd) > and hit control-C and got: Do you have SIGINT trapped? -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - H

Re: weird error due to cntrl-c out of history list

2017-02-20 Thread Chris F.A. Johnson
On Sun, 19 Feb 2017, L A Walsh wrote: In both 4.3.42(2)-release and 4.4.5(1)-release, I was listing my history (history cmd) and hit control-C and got: 4402 0502@091824: ls * 4403 0502@091901: cd .. 4404 0502@091930: cd xyzzy-1.8.4.1/ 4405 0502@091932: ls 4406 0502@091939: grep -r template

get bash completion output programatically

2017-02-20 Thread acornejo
The title says it all. Example: get_completion "git a" > add > am > annotate > apply > archive get_completion "ls --a" > --all > --almost-all > --author There are various attempts to do it online, the most complete seems to be: https://brbsix.github.io/2015/11/29/accessing-tab-completion-progr

Re: Segfaults on long non-ASCII current directory in X terminal

2017-02-20 Thread Chet Ramey
On 2/19/17 4:50 PM, fbri...@fbriere.net wrote: > Bash Version: 4.4 > Patch Level: 11 > Release Status: release > > Description: > > [This was originally filed as https://bugs.debian.org/843819.] > > Bash will segfault when the following two conditions are met: > > - A long current directory p

Re: Does bash treat segment fault causing by scripts as security bugs ?

2017-02-20 Thread Chet Ramey
On 2/19/17 9:11 PM, kkk K wrote: > ok,one poc I think should like this: > = > #!/bin/bash > a="1||" > b=`printf "%.s"$a {1..5}`"1" > eval $b > = > this code will make a segment fault, of cource , eval or printf actually is > not necessary, > the p

Segfaults on long non-ASCII current directory in X terminal

2017-02-20 Thread Frédéric Brière
[Re-sending manually, as I think the first copy got lost. Apparently, bashbug and Postfix did not get along very well.] Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -

Segfaults on long non-ASCII current directory in X terminal

2017-02-20 Thread fbriere
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' -DPACKA