2021年5月6日星期四

How to parse a config file with tab indented options with sed?

config wifi-device 'radio0'          option type 'mac80211'          option hwmode '11g'          option path 'platform/soc/a000000.wifi'          option legacy_rates '1'          option mu_beamformer '0'          option country 'US'          option channel '1'          option vendor_vht '1'          option htmode 'HT20'          option txpower '13'    config wifi-device 'radio1'          option type 'mac80211'          option hwmode '11a'          option path 'platform/soc/a800000.wifi'          option htmode 'VHT80'          option country 'US'          option mu_beamformer '0'          option txpower '16'          option legacy_rates '0'          option channel '60'  

For example, I want to find radio1 > channel(in this example 60) in this config file and replace it with 99, can I do it with sed? or some other linux tools?

https://stackoverflow.com/questions/67427998/how-to-parse-a-config-file-with-tab-indented-options-with-sed May 07, 2021 at 09:47AM

没有评论:

发表评论