Re: Strange file -i

2015-03-05 Thread Mike Frysinger
On 05 Mar 2015 15:20, Chet Ramey wrote: > On 3/4/15 6:07 PM, Stephane Chazelas wrote: > > $ perl -ne 'print if /foo/' * > > I just use grep directly. fwiw, git has a grep helper. this tends to be faster than a plain grep since it automatically filters out ignored files. you just have to remem

Re: certain strings both legal and illegal as associative array keys

2015-03-05 Thread Chet Ramey
On 3/1/15 1:05 AM, vampyre...@gmail.com wrote: > Bash Version: 4.2 > Patch Level: 45 > Release Status: release > > Description: > > A string is either legal or not legal as a key for an associative array. > However, bash accepts certain keys in some contexts but not in other > contexts, makin

Re: Strange file -i

2015-03-05 Thread Chet Ramey
On 3/5/15 3:52 PM, Stephane Chazelas wrote: > 2015-03-05 15:20:44 -0500, Chet Ramey: > [...] >> For example, I never do this: >> >>> $ perl -ne 'print if /foo/' * >> >> I just use grep directly. > > That was just a basic example. > > What about: > > sed 's/foo/bar/g' * > > ? Yes, I literally n

Re: Strange file -i

2015-03-05 Thread Stephane Chazelas
2015-03-05 15:20:44 -0500, Chet Ramey: [...] > For example, I never do this: > > > $ perl -ne 'print if /foo/' * > > I just use grep directly. That was just a basic example. What about: sed 's/foo/bar/g' * ? > Or this: > > > rm -- * [...] Then, you're in for some bad surprise some day. Yo

Re: Strange file -i

2015-03-05 Thread Chet Ramey
On 3/4/15 6:07 PM, Stephane Chazelas wrote: > 2015-03-04 09:25:46 -0600, John McKown: >> On Wed, Mar 4, 2015 at 7:43 AM, Eric Blake wrote: >>> On 03/04/2015 01:44 AM, Jean Delvare wrote: Hi Chet, Did you really intend to create an empty file named "-i" in http://git.savannah.gn

Re: Bug in sh_backslash_quote function (bash 4.3.33)

2015-03-05 Thread Chet Ramey
On 3/4/15 12:59 PM, Верещагин Алексей wrote: > Bash Version: 4.3.33 > File: lib/sh/shquote.c > Function: sh_backslash_quote > Line: if (backslash_table[c] == 1) > > Description > --- > Variable "c" has signed integer type and may be negative (if "string" is > not only ASCII characters stri

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Stephane Chazelas
2015-03-05 12:36:39 -0500, Greg Wooledge: > On Thu, Mar 05, 2015 at 05:26:00PM +, Stephane Chazelas wrote: > > The bash manual only points to regex(3). > > > > So it's down to your system's regex library (uses > > regcomp(REG_EXTENDED)) which on recent GNU systems supports \s. > > I see. So

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Greg Wooledge
On Thu, Mar 05, 2015 at 05:26:00PM +, Stephane Chazelas wrote: > The bash manual only points to regex(3). > > So it's down to your system's regex library (uses > regcomp(REG_EXTENDED)) which on recent GNU systems supports \s. I see. So it's another nonportable feature like printf '%(%s)T'. G

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Stephane Chazelas
2015-03-05 12:14:21 -0500, Greg Wooledge: > On Thu, Mar 05, 2015 at 05:07:44PM +, Stephane Chazelas wrote: > > bash also supports \s, but that's more for [[:space:]] (so > > includes vertical spacing like CR, LF), and you need to use an > > intermediary variable: > > > > r='^some text:\s+([0-9

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Greg Wooledge
On Thu, Mar 05, 2015 at 05:07:44PM +, Stephane Chazelas wrote: > bash also supports \s, but that's more for [[:space:]] (so > includes vertical spacing like CR, LF), and you need to use an > intermediary variable: > > r='^some text:\s+([0-9.]+)' > [[ $s =~ $r ]] Woah! What? Where is *that*

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Stephane Chazelas
2015-03-05 14:26:48 +, Jason Vas Dias: > Good day list, Chet - > > I think this is a bug: > ( set -x ; tab=$'\011'; s="some text: 1.2.3"; > if [[ "$s" =~ ^some text:[\ $tab]+([0-9.]+) ]]; then > echo "${BASH_REMATCH[1]}"; > fi > ) > -bash: syntax error in conditional expression > -ba

Re: Memory leak in wait

2015-03-05 Thread Chet Ramey
On 2/28/15 5:29 AM, Jean Delvare wrote: > On Fri, 07 Nov 2014 08:24:07 -0500, Chet Ramey wrote: >> On 11/7/14, 3:49 AM, Jean Delvare wrote: >>> 2* If bash remembers the process statuses, how does one access the >>>information? I couldn't find anything related to that in the manual >>>page,

Re: dead link

2015-03-05 Thread Chet Ramey
> The problem is that the link under [promptvars] points to > http://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html#Controlling-the-Prompt, > and not to the link mentioned above. Since the single-page version of the manual is fine, I am assuming that this is some problem wi

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Eduardo A . Bustamante López
On Thu, Mar 05, 2015 at 02:26:48PM +, Jason Vas Dias wrote: > Good day list, Chet - > > I think this is a bug: > ( set -x ; tab=$'\011'; s="some text: 1.2.3"; > if [[ "$s" =~ ^some text:[\ $tab]+([0-9.]+) ]]; then > echo "${BASH_REMATCH[1]}"; > fi > ) > -bash: syntax error in conditi

Re: Errors in command substitution when typing: echo "$(echo "

2015-03-05 Thread Chet Ramey
On 2/26/15 4:30 PM, Ingo Ruhnke wrote: > Bash Version: 4.3 > Patch Level: 30 > Release Status: release > > Description: > > Trying to tab complete the following produces half a screen full of errors: > > echo "$(echo " > > bash: command substitution: line 3: unexpected EOF while looking for >

bash-4.3.33 regexp bug

2015-03-05 Thread Jason Vas Dias
Good day list, Chet - I think this is a bug: ( set -x ; tab=$'\011'; s="some text: 1.2.3"; if [[ "$s" =~ ^some text:[\ $tab]+([0-9.]+) ]]; then echo "${BASH_REMATCH[1]}"; fi ) -bash: syntax error in conditional expression -bash: syntax error near `$tab]+([0-9.]+)' Do you agree ? If not,