From: Robert Rothenberg Date: 15:33 on 25 Apr 2007 Subject: Feisty or Bash hate I'm not entirely sure which one of these to hate, so I think I'll spread it evenly and hate both of them. In Bash 3.2, the syntax of regular expressions were changed. So if [[ $string =~ 'foo(.*)' ]] then ... should become if [[ $string =~ foo(.*) ]] then ... You can imagine how many scripts that breaks. Well, maybe there's a justification. Oh by the way, Ubuntu Feisty, included an upgrade to Bash 3.2. No warning about that in the Release Notes at http://www.ubuntu.com/getubuntu/releasenotes/704 Oops.
From: Peter da Silva Date: 02:49 on 26 Apr 2007 Subject: Re: Feisty or Bash hate On Apr 25, 2007, at 9:33 AM, Robert Rothenberg wrote: > In Bash 3.2, the syntax of regular expressions were changed. So > > if [[ $string =~ 'foo(.*)' ]] then ... > > should become > > if [[ $string =~ foo(.*) ]] then ... > > You can imagine how many scripts that breaks. OK, I can see no good reason for that. If they want to change the shell syntax to default-quoted everywhere, and give it a new name, then fine... but, no, that's hateful.
From: A. Pagaltzis Date: 05:04 on 26 Apr 2007 Subject: Re: Feisty or Bash hate * Robert Rothenberg <robrwo@xxxxx.xxx> [2007-04-25 16:40]: > In Bash 3.2, the syntax of regular expressions were changed. So > > if [[ $string =~ 'foo(.*)' ]] then ... > > should become > > if [[ $string =~ foo(.*) ]] then ... > > You can imagine how many scripts that breaks. Wow. So what new way of writing the following do they propose? if [[ $string =~ ' foo ' ]] ; then ... Regards,
From: Robert Rothenberg Date: 23:52 on 26 Apr 2007 Subject: Re: Feisty or Bash hate On 26/04/07 05:04 A. Pagaltzis wrote: > Wow. So what new way of writing the following do they propose? > > if [[ $string =~ ' foo ' ]] ; then ... Apparently it's if [[ $string =~ \ foo\ ]] ; then ... which looks to my Perl-stained eyes like / foo/ (no trailing whitespace). Non-denumerably hateful.
From: Peter da Silva Date: 00:01 on 27 Apr 2007 Subject: Re: Feisty or Bash hate On Apr 26, 2007, at 5:52 PM, Robert Rothenberg wrote: > if [[ $string =~ \ foo\ ]] ; then ... That's just wrong. I mean, it's correct syntax, but it's wrong to have to use that syntax exclusively instead of quoting.. What is their logic?
From: A. Pagaltzis Date: 00:15 on 27 Apr 2007 Subject: Re: Feisty or Bash hate * Robert Rothenberg <robrwo@xxxxx.xxx> [2007-04-27 00:55]: > On 26/04/07 05:04 A. Pagaltzis wrote: > > Wow. So what new way of writing the following do they > > propose? > > > > if [[ $string =~ ' foo ' ]] ; then ... > > Apparently it's > > if [[ $string =~ \ foo\ ]] ; then ... I expected that answer. I don't need to actually say what I think of that. Regards,
From: Phil Pennock Date: 05:24 on 26 Apr 2007 Subject: Re: Feisty or Bash hate On 2007-04-25 at 15:33 +0100, Robert Rothenberg wrote: > In Bash 3.2, the syntax of regular expressions were changed. So > > if [[ $string =~ 'foo(.*)' ]] then ... I like that =~ operator. In zsh, you zmodload zsh/pcre and then use the -pcre-match operator, thus: if [[ $string -pcre-match 'foo(.*)' ]]; then ... ; fi I like it so much, I just submitted a patch for zsh which introduces the =~ operator to autoload the PCRE module as required and then map to the -pcre-match operator. With this, the zsh support for regexps handles quoted or unquoted, as per bash prior to 3.2. Y'know, switching to The Other Shell is never one killer feature, it's all the neat stuff which taken together is just nicer. ObHate: zsh may be powerful but the extended syntax can sometimes make Perl JAPH hacks look like elegant models of clean design. -Phil
From: A. Pagaltzis Date: 05:38 on 26 Apr 2007 Subject: Re: Feisty or Bash hate * Phil Pennock <phil.pennock@xxxxxxx.xxx> [2007-04-26 06:30]: > ObHate: zsh may be powerful but the extended syntax can > sometimes make Perl JAPH hacks look like elegant models > of clean design. Shells inherently blow. Now if only they weren't also so damn useful... Regards,
Generated at 12:28 on 17 Feb 2008 by mariachi