Re: How to match regex in bash? (any character)

2011-09-29 Thread Stephane CHAZELAS
2011-09-29, 13:52(-08), Roger: [...] > Since you're saying the regex description is found within either regex(3) or > regex(7), couldn't there be a brief note within the Bash Manual Page be > something > to the effect: [...] No, it's not. I suppose bash could say: See your system regex(3) implem

Re: a suggestion: an error message could be more helpful

2011-09-29 Thread Chet Ramey
On 9/28/11 5:39 PM, daysleeper wrote: > Bash Version: 4.2 > Patch Level: 0 > Release Status: release > > Description: > If you run a 64-bit executable on a 32-bit system via bash (which can > happen by accident), it gives an "bash: ./fwupd: cannot execute binary > file" error message. What se

a suggestion: an error message could be more helpful

2011-09-29 Thread daysleeper
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPAC

Re: How to match regex in bash? (any character)

2011-09-29 Thread Roger
> On Thu, Sep 29, 2011 at 12:06:08PM -0400, Chet Ramey wrote: >On 9/29/11 11:59 AM, Peng Yu wrote: >> On Thu, Sep 29, 2011 at 10:38 AM, Chet Ramey wrote: >>> On 9/29/11 9:48 AM, Peng Yu wrote: >>> Therefore, either bash manpage should specify clearly which regex manpage it should be in e

Re: How to match regex in bash? (any character)

2011-09-29 Thread Chet Ramey
On 9/29/11 1:46 PM, Greg Wooledge wrote: >An additional binary operator, =~, is available, with the same >precedence as == and !=. When it is used, the string to the >right of the operator is considered an extended regular >expression and matched ac

Re: How to match regex in bash? (any character)

2011-09-29 Thread Chet Ramey
On 9/29/11 12:06 PM, Greg Wooledge wrote: >> As I mentioned previously, the best is to add a few examples in man >> bash. > > I would not object to that, but I can't speak for Chet. As I said, I will add examples to the info manual and some more explanation to the man page. Regular expressions

Re: How to match regex in bash? (any character)

2011-09-29 Thread Greg Wooledge
On Thu, Sep 29, 2011 at 11:18:57AM -0500, Peng Yu wrote: > Also, regex(3) does not mention the difference between $x =~ .txt > and $x=~ ".txt". I think that the difference should be addressed > in man bash. It already is. An additional binary operator, =~, is available, with th

Re: How to match regex in bash? (any character)

2011-09-29 Thread Roman Rakus
On 09/29/2011 06:18 PM, Peng Yu wrote: Also, regex(3) does not mention the difference between $x =~ .txt and $x=~ ".txt". I think that the difference should be addressed in man bash. It is in man bash. RR

Re: How to match regex in bash? (any character)

2011-09-29 Thread Peng Yu
On Thu, Sep 29, 2011 at 11:06 AM, Greg Wooledge wrote: > On Thu, Sep 29, 2011 at 10:59:19AM -0500, Peng Yu wrote: >> We all have discovered that regex(3) is not consistent across all the >> platform. Why you say it is portable? > > The three systems I mentioned earlier today all have regex(3).  Wh

Re: How to match regex in bash? (any character)

2011-09-29 Thread Greg Wooledge
On Thu, Sep 29, 2011 at 10:59:19AM -0500, Peng Yu wrote: > We all have discovered that regex(3) is not consistent across all the > platform. Why you say it is portable? The three systems I mentioned earlier today all have regex(3). Which system have you found, which doesn't have it? > As I menti

Re: How to match regex in bash? (any character)

2011-09-29 Thread Chet Ramey
On 9/29/11 11:59 AM, Peng Yu wrote: > On Thu, Sep 29, 2011 at 10:38 AM, Chet Ramey wrote: >> On 9/29/11 9:48 AM, Peng Yu wrote: >> >>> Therefore, either bash manpage should specify clearly which regex >>> manpage it should be in each system (which a bad choice, because there >>> can be a large num

Re: How to match regex in bash? (any character)

2011-09-29 Thread Peng Yu
On Thu, Sep 29, 2011 at 10:38 AM, Chet Ramey wrote: > On 9/29/11 9:48 AM, Peng Yu wrote: > >> Therefore, either bash manpage should specify clearly which regex >> manpage it should be in each system (which a bad choice, because there >> can be a large number of systems), or the bash manpage should

Re: How to match regex in bash? (any character)

2011-09-29 Thread Chet Ramey
On 9/29/11 9:48 AM, Peng Yu wrote: > Therefore, either bash manpage should specify clearly which regex > manpage it should be in each system (which a bad choice, because there > can be a large number of systems), or the bash manpage should omit all > the non consistent reference and say something

Re: How to match regex in bash? (any character)

2011-09-29 Thread Peng Yu
On Thu, Sep 29, 2011 at 7:22 AM, Greg Wooledge wrote: > On Wed, Sep 28, 2011 at 12:43:01PM -0800, Roger wrote: >> Seems I used 'man regex' as well here.  AKA regex(3).  But I did >> realize this a few weeks ago; the real regex description being 'man 7 regex'. >> The Bash Manual Page denotes only r

Re: How to match regex in bash? (any character)

2011-09-29 Thread Greg Wooledge
On Wed, Sep 28, 2011 at 12:43:01PM -0800, Roger wrote: > Seems I used 'man regex' as well here. AKA regex(3). But I did > realize this a few weeks ago; the real regex description being 'man 7 regex'. > The Bash Manual Page denotes only regex(3). You're relatively fortunate that it's *that* easy

Re: How to match regex in bash? (any character)

2011-09-29 Thread Chet Ramey
> Seems I used 'man regex' as well here. AKA regex(3). But I did > realize this a few weeks ago; the real regex description being 'man 7 regex'. > The Bash Manual Page denotes only regex(3). Not all the world is Linux. The regex(3) reference is the only one that is consistent across different o