[ofa-general] Re: [PATCH] infiniband-diags/scripts/ibprintswitch.pl: fix regex when searching for switch by name

Sasha Khapyorsky sashak at voltaire.com
Sun Jan 20 07:04:21 PST 2008


On 18:55 Sat 19 Jan     , Sasha Khapyorsky wrote:
> > diff --git a/infiniband-diags/scripts/ibprintswitch.pl b/infiniband-diags/scripts/ibprintswitch.pl
> > index d28a839..23a39b5 100755
> > --- a/infiniband-diags/scripts/ibprintswitch.pl
> > +++ b/infiniband-diags/scripts/ibprintswitch.pl
> > @@ -104,7 +104,7 @@ sub main
> >                 print $ports{$port};
> >              }
> >           }
> > -         if ("0x$guid" eq $target_switch || $desc =~ /.*$target_switch\s+.*/)
> > +         if ("0x$guid" eq $target_switch || $desc =~ /.*$target_switch.*/)
> 
> When the original regex will not work?

Actually I think I see why this change is. You want to match node
description as regex. Looks fine for me.

Sasha



More information about the general mailing list