Re: RFE: allow double quotes to group multi-words & be treated?as?1?arg, w/DQ's stripped off -- including RH =~

2010-08-09 Thread clemens fischer
clemens fischer wrote: > [...] If you received several emails/posts, I apologize. This was a problem with "news.eternal-september.org". My article was sent only once from my box. clemens

Re: RFE: allow double quotes to group multi-words & be treated as?1?arg, w/DQ's stripped off -- including RH =~

2010-08-06 Thread clemens fischer
Greg Wooledge wrote: > In this particular case, I would use a glob rather than an ERE, > because "h?" is much simpler than "^h.$". Besides, bash's extended globs provide everything ERE's provide. I use the idiom: shopt -s extglob # for example, to check for numbers case "-${somethin

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-05 Thread Chet Ramey
On 8/5/10 2:56 AM, Linda Walsh wrote: > Couldn't you have limited to single quotes -- reserving to them the > function of literalizing what is between them. No. That's not the difference between single and double quotes. Why would I complicate things further? > Otherwise, could you think other

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-05 Thread Andreas Schwab
Linda Walsh writes: > Or, why should double quotes be functionally the same as single quotes > in that situation? Handling it different from glob meta characters would make it even more special. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-05 Thread Linda Walsh
On 8/4/2010 10:07 PM, Chet Ramey wrote: > On 8/4/10 8:31 AM, Greg Wooledge wrote: > >> In fact, putting the ERE-pattern you want to match against into a variable >> and then using =~ $variable *is* the recommended practice, if you need to >> use =~ at all. It is the only way to get consistent r

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-04 Thread Chet Ramey
On 8/4/10 8:31 AM, Greg Wooledge wrote: > In fact, putting the ERE-pattern you want to match against into a variable > and then using =~ $variable *is* the recommended practice, if you need to > use =~ at all. It is the only way to get consistent results among all > the different releases of bash

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-04 Thread Greg Wooledge
On Wed, Aug 04, 2010 at 02:02:39AM -0700, Linda Walsh wrote: > Other string operators? What other ones operate this way? > > This is what I'm referring to: > > a="hi" > if [[ "hi" == "$a" ]]; then echo "this matches"; fi > if [[ 'hi' == '$a' ]] then echo "this doesn't"; fi You are misunderstand

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-04 Thread Marc Herbert
Le 04/08/2010 09:27, Davide Brini a écrit : > From the Changelog: > > This document details the changes between this version, bash-3.2-alpha, > and the previous version, bash-3.1-release. > ... > 3. New Features in Bash > ... > f. Quoting the string argument to the [[ command's =~ operator now

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-04 Thread Andreas Schwab
Linda Walsh writes: > I would prefer this work: > > a="h." > > if [[ "hi" =~ "$a" ]]; This works (both with and without compat31): [[ "hi" =~ $a ]] && echo matches (It doesn't matter how you quote the lhs, anyway.) Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint =

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-04 Thread Linda Walsh
Oi vey. Is that the only thing that will be affected by shopt -s compat31? Or perhaps that shopt needs to be a bit more specific. > So your example would have worked with "shopt -s compat31". > >From the file COMPAT: 33. Bash-3.2 adopts the convention used by other string and pattern matchi

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-04 Thread Davide Brini
On Wednesday 04 Aug 2010 09:06:16 Linda Walsh wrote: > On 8/1/2010 8:11 PM, Chris F.A. Johnson wrote: > > On Sun, 1 Aug 2010, Linda Walsh wrote: > >> I have: > >> > >> w="/home/law/bin/package: line 5: type: xx: not found" > >> > >> The =~ operator is suppose to use the RH Expr as a ext.-regex. >

RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-04 Thread Linda Walsh
On 8/1/2010 8:11 PM, Chris F.A. Johnson wrote: > On Sun, 1 Aug 2010, Linda Walsh wrote: > >> I have: >> >> w="/home/law/bin/package: line 5: type: xx: not found" >> >> The =~ operator is suppose to use the RH Expr as a ext.-regex. >> >> So why doesn't this match and print "not found"? >> >> if [