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