rahulruns has asked for the wisdom of the Perl Monks concerning the following question:
I am working on SLES ifcfg file and there is a entry of parameter BONDING_MODULE_OPTS='mode=1 miimon=100 primary=p3p1 primary_reselect=1'. I tried using split function to split based on "=" but I want to extract values of mode miimon primary and primary_reselect and store it in a hash. Also other parameters in ifcfg have single entry like IPADDR. I am iterating through file and storing these values in a hash as key value. I need to extract for BONDING_MODULE_OPTS and store these in that hash. I am not getting how do I do it
FILE BONDING_MASTER='yes' BONDING_MODULE_OPTS='mode=active-backup miimon=100 primary=p6p2 primar +y_reselect=1' BONDING_SLAVE0='x' BONDING_SLAVE1='y' BOOTPROTO='static' BROADCAST='' ETHTOOL_OPTIONS='' IPADDR='' MTU='' NAME='Bond1' NETMASK='255.255.0.0' NETWORK='' REMOTE_IPADDR='' STARTMODE='none' USERCONTROL='no'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Extracting strings around comparision operator
by BrowserUk (Patriarch) on Aug 20, 2015 at 05:18 UTC | |
by rahulruns (Scribe) on Aug 20, 2015 at 10:32 UTC | |
Re: Extracting strings around comparision operator
by Monk::Thomas (Friar) on Aug 20, 2015 at 07:32 UTC | |
by Anonymous Monk on Aug 20, 2015 at 07:39 UTC | |
by Monk::Thomas (Friar) on Aug 20, 2015 at 08:09 UTC |