Re: regex subexpressions broken

2007-05-12 Thread Chet Ramey
[EMAIL PROTECTED] wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i686
> OS: linux-gnu
> Compiler: i686-pc-linux-gnu-gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
> -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -march=athlon-tbird -O3 
> -fomit-frame-pointer -pipe
> uname output: Linux gollum 2.6.18-gentoo-r4 #1 PREEMPT Sat Dec 9 14:19:35 CET 
> 2006 i686 AMD Athlon(tm) processor AuthenticAMD GNU/Linux
> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 3.2
> Patch Level: 15
> Release Status: release
> 
> Description:
> [[ "a b c" =~ "a (.) c" ]]
> echo ${BASH_REMATCH[1]}
> 
> Does not return a result any more. It used to work.

Beginning with bash-3.2, quoting the rhs of the =~ operator causes the
quoted portions to be matched as strings, as the == operator works.

This is in the latest version of the Bash FAQ, which, for some reason,
I have been blocked from posting to bug-bash.  I will try again.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
   Live Strong.  No day but today.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


read 1 var in when executing command

2007-05-12 Thread jdh239

I saw something similar to this in the archives already, but didn't see a
real answer.  I am modifying my 'whois' command to just grep for the
expiration date of my domains:

ie jwhois

whois $DOM | grep -i expi | grep -i -e jan -e feb -e mar -e apr -e may -e
jun -e jul -e aug -e sep -e oct -e nov -e dec | grep -i -v date

What I would like is to pass in the parameter in the commandline:  jwhois
 

Currently I have:
echo -n "Enter the domain name: "
read DOM

I would prefer, again, just to execute the command with the domain name
following  Not sure how to do it.  I have been looking around and saw
things like getopts, but I am only passing in one variable and thought it
should be fairly simple

Thanks in advance.
-- 
View this message in context: 
http://www.nabble.com/read-1-var-in-when-executing-command-tf3732385.html#a10447367
Sent from the Gnu - Bash mailing list archive at Nabble.com.



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: read 1 var in when executing command

2007-05-12 Thread Paul Jarc
jdh239 <[EMAIL PROTECTED]> wrote:
> I would prefer, again, just to execute the command with the domain name
> following  Not sure how to do it.

You can define the command as a shell function (see "Shell Function
Definitions" in the man page under "SHELL GRAMMAR").  You can refer to
the first argument as $1 (see "Positional Parameters", under
"PARAMETERS").


paul


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: read 1 var in when executing command

2007-05-12 Thread jdh239



Paul Jarc wrote:
> 
> jdh239 <[EMAIL PROTECTED]> wrote:
>> I would prefer, again, just to execute the command with the domain name
>> following  Not sure how to do it.
> 
> You can define the command as a shell function (see "Shell Function
> Definitions" in the man page under "SHELL GRAMMAR").  You can refer to
> the first argument as $1 (see "Positional Parameters", under
> "PARAMETERS").
> 
> 
> paul
> 
> 
> ___
> Bug-bash mailing list
> Bug-bash@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-bash
> 
> 

Thanks for the info, but my man page as specified above has no such
sections

-- 
View this message in context: 
http://www.nabble.com/read-1-var-in-when-executing-command-tf3732385.html#a10452469
Sent from the Gnu - Bash mailing list archive at Nabble.com.



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash