|Perl: the Markov chain saw|
Remove text after and beforeby muizelaar (Sexton)
|on May 22, 2012 at 09:40 UTC||Need Help??|
muizelaar has asked for the
wisdom of the Perl Monks concerning the following question:
Need some help with this, Iím attempting to try and read in the below which is system output for one of the NIC on my server.
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:4e:97:a1 brd ff:ff:ff:ff:ff:ff
I want to be able to strip away all characters before eth1 including all white space and eveything after eth1: so Iím just left with eth1.
I have tried various regular expression but canít seem to trap : unless you can think of a better way to do it.
Then print out back to the file handle just the NIC adapter name
This is what I have so far, not much to go on but should give oyu an idea of what im trying to do