Re: AddressSanitizer: heap-buffer-overflow lib/readline/bind.c:437 in rl_translate_keyseq

2017-05-01 Thread Eduardo Bustamante
On Mon, May 1, 2017 at 11:58 PM, Eduardo Bustamante wrote: > Thanks, the latest commit no longer crashes on any of the malformed input > files. > > There's still a memory leak I hadn't noticed before: > [...] > bash-4.4$ bind '\xx":""' Actually, this one is shorter: bind '\:""' rl_translate_

Re: AddressSanitizer: heap-buffer-overflow lib/readline/bind.c:437 in rl_translate_keyseq

2017-05-01 Thread Eduardo Bustamante
Thanks, the latest commit no longer crashes on any of the malformed input files. There's still a memory leak I hadn't noticed before: dualbus@debian:~/src/gnu/bash$ ./bash bash-4.4$ bind '\xx":""' bash-4.4$ exit = ==27221==ERROR: Le

Re: Syntax error near unexpected token `newline' within loops

2017-05-01 Thread Eduardo Bustamante
On Mon, Apr 24, 2017 at 3:48 PM, Chet Ramey wrote: [...] > That works on Linux, but not on the BSDs, since Posix says it doesn't > have to. I see that a test for this has been added to comsub.tests: dualbus@debian:~/src/gnu/bash$ git log -1 -p -- tests/comsub.tests commit 2a39157723ffb7dfc597dfa

Re: Bash -f Test Operator - Not working as expected

2017-05-01 Thread Eduardo Bustamante
On Mon, May 1, 2017 at 8:52 PM, Eduardo Bustamante wrote: > On Sat, Apr 29, 2017 at 8:56 PM, Adam Danischewski > wrote: >> In the documentation you linked to it says: >> >> -f file >> True if file exists and is a regular file. >> >> The part of the documentation you cited states "Unless otherwise

Re: [suggestion] Brace expansion configurability

2017-05-01 Thread Chet Ramey
On 4/30/17 11:23 AM, omasmotorrad wrote: > Why is it that one cannot change the delimiter for the > words generated during brace expansion? Because they are separate words that are expanded individually, not a single word that undergoes word splitting. They end up being separate arguments to, e.g

Re: Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Chet Ramey
On 5/1/17 11:21 AM, Florian Mayer wrote: >> imadev:~$ {1..10}'+ 0' >> + '1+ 0' '2+ 0' '3+ 0' '4+ 0' '5+ 0' '6+ 0' '7+ 0' '8+ 0' '9+ 0' '10+ 0' >> bash: 1+ 0: command not found >> >> It most certainly does not evaluate to 55. > Oh, it would've with the expansion put into arithmetic context. It woul

Re: Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Chet Ramey
On 5/1/17 10:37 AM, Florian Mayer wrote: > >> OK. This starts out as one word: "{1..10}'+' +0". Brace expansion > Ok, that's obviously a dumb mistake. And everything you wrote is right. > > Just to clean up the mistake: > $ (( {1..10}'+' 0)) # spaces before { and 0 > > So, as you described, wha

Re: Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Florian Mayer
imadev:~$ {1..10}'+ 0' + '1+ 0' '2+ 0' '3+ 0' '4+ 0' '5+ 0' '6+ 0' '7+ 0' '8+ 0' '9+ 0' '10+ 0' bash: 1+ 0: command not found It most certainly does not evaluate to 55. Oh, it would've with the expansion put into arithmetic context. Why can't we just write a loop? Oh, WE could. But where woul

Re: Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Greg Wooledge
On Mon, May 01, 2017 at 04:37:10PM +0200, Florian Mayer wrote: > $ "{1..10}'+' 0" > actually is seen as > $ "{1..10}'+ 0'" # postabmle = '+0' > Then, it expands that to > '1+ 0 2+ 0 3+ 0 4+ 0 5+ 0 6+ 0 7+ 0 8+ 0 9+ 0 10+ 0' > and evaluates it arithmetically resulting in 55. No, and no. I think yo

Re: Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Florian Mayer
OK. This starts out as one word: "{1..10}'+' +0". Brace expansion Ok, that's obviously a dumb mistake. And everything you wrote is right. Just to clean up the mistake: $ (( {1..10}'+' 0)) # spaces before { and 0 So, as you described, what bash actually does is it takes $ (( {1..10}'+' 0)) go

Re: Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Chet Ramey
On 5/1/17 9:49 AM, Florian Mayer wrote: > However, > $ (({1..10}'+' +0)) > Gives me "bash: ((: 1+ +0 2+ +0 3+ +0 4+ +0 5+ +0 6+ +0 7+ +0 8+ +0 9+ +0 > 10+ +0: syntax" > which is the same thing I'd get, when I whould've done {1..10}'+ +0'. Thus > in this same arithmetic expansion context bash _does

Re: Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Chet Ramey
On 5/1/17 10:00 AM, Greg Wooledge wrote: > On Mon, May 01, 2017 at 03:49:39PM +0200, Florian Mayer wrote: >> However, >> $ (({1..10}'+' +0)) >> Gives me "bash: ((: 1+ +0 2+ +0 3+ +0 4+ +0 5+ +0 6+ +0 7+ +0 8+ +0 9+ >> +0 10+ +0: syntax" >> which is the same thing I'd get, when I whould've done {1.

Re: Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Greg Wooledge
On Mon, May 01, 2017 at 03:49:39PM +0200, Florian Mayer wrote: > However, > $ (({1..10}'+' +0)) > Gives me "bash: ((: 1+ +0 2+ +0 3+ +0 4+ +0 5+ +0 6+ +0 7+ +0 8+ +0 9+ > +0 10+ +0: syntax" > which is the same thing I'd get, when I whould've done {1..10}'+ +0'. Thus > in this same arithmetic expan

Re: Space removal in AE takes place before brace expansion

2017-05-01 Thread Chet Ramey
On 4/30/17 2:31 PM, Florian Mayer wrote: > I want to add up all numbers from 1 to 10, but when I do > $ echo $(({1,10}’+’ +0)) # with a space between the first + and the second one > I get an error: > bash: ((: 1+ ,3 10+ ,3: syntax error: operand expected (error token is ",3 > 10+ ,3“) First of

Clarification - Space removal in AE takes place before brace expansion

2017-05-01 Thread Florian Mayer
From my previous mail: $ echo $(({1..10}’+’ +0)) # with a space between the first + and the second one I'm sorry, I assumed that $(()) and (( )) so the exact same thing so I only included the $(()) version instead of what I tested on my machine. Apparently both versions do not behave the same.

Re: Space removal in AE takes place before brace expansion

2017-05-01 Thread Florian Mayer
If your commands "work" in your shell, but then magically transform into unusable curly quote glyphs in your mail client, then it's probably your mail client performing the transformation. Or your text editor, or your web browser if you're using web-mail. Your apostrophes in the words "don't" an

Re: Space removal in AE takes place before brace expansion

2017-05-01 Thread Greg Wooledge
On Mon, May 01, 2017 at 03:29:43PM +0200, Florian Mayer wrote: > > sum=0; for ((i=1; i<=10; i++)); do ((sum+=i)); done > You can actually omit ???sum=0;???, because bash dereferences unset variables > to 0 > (according to the holy manual of course). Not if the user running the script exported sum

Re: Space removal in AE takes place before brace expansion

2017-05-01 Thread Florian Mayer
> sum=0; for ((i=1; i<=10; i++)); do ((sum+=i)); done You can actually omit ‚sum=0;‘, because bash dereferences unset variables to 0 (according to the holy manual of course). > I cannot figure out what you actually typed here, because your UTF-8 I don’t know what caused that, but it was not inten

Re: Space removal in AE takes place before brace expansion

2017-05-01 Thread Greg Wooledge
On Sun, Apr 30, 2017 at 08:31:30PM +0200, Florian Mayer wrote: > I want to add up all numbers from 1 to 10, sum=0; for ((i=1; i<=10; i++)); do ((sum+=i)); done > but when I do > $ echo $(({1,10}???+??? +0)) # with a space between the first + and the > second one I cannot figure out what you ac

Re: globstar question

2017-05-01 Thread Chet Ramey
On 4/29/17 11:22 PM, L A Walsh wrote: > > > Chet Ramey wrote: >> On 4/28/17 8:09 PM, L A Walsh wrote: >>> ls **Tokyo* >>> (nothing) >>> ls ***Tokyo* >>> (nothing) >>> ls **Tokyo**Tokyo* >>> (nothing) >>> ls **/*Tokyo* >>> (found multiple matches (including the one I was >>> searching for)) >>>

Re: Bash -f Test Operator - Not working as expected

2017-05-01 Thread Greg Wooledge
On Sat, Apr 29, 2017 at 07:47:06PM -0400, Adam Danischewski wrote: > $ [[ -L > "/mnt/samsung32/.word_list_repo/instruments_song_repo/546725_pinstripe.mp3" > ]] && echo hi > hi > $ [[ -f > "/mnt/samsung32/.word_list_repo/instruments_song_repo/546725_pinstripe.mp3" > ]] && echo hi > hi > > It looks