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'
In reply to Extracting strings around comparision operator by rahulruns
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |