Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: remove lines that do not match search pattern

by GotToBTru (Prior)
on Aug 04, 2015 at 13:09 UTC ( [id://1137371]=note: print w/replies, xml ) Need Help??


in reply to remove lines that do not match search pattern

Do you really want to remove lines that don't have a MAC address, or do you want to keep lines that do?

I don't have Expect installed, so I can't test this, but looking at the documentation, it appears the $obj->expect($cmd,@params) and $obj->matchlist() contain the functionality you need. @params needs to contain a single entry, a regex that matches MAC addresses. matchlist() will return an array(?) of matching lines from the output of $cmd.

Dum Spiro Spero
  • Comment on Re: remove lines that do not match search pattern

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1137371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found