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

Ira Weiny weiny2 at llnl.gov
Tue Jan 22 09:03:32 PST 2008


On Sun, 20 Jan 2008 15:04:21 +0000
Sasha Khapyorsky <sashak at voltaire.com> wrote:

> 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.

Yes exactly.

Ira



More information about the general mailing list