Bash: Update a variable within a file

前端 未结 3 1850
滥情空心
滥情空心 2021-01-26 03:41

I know this is a simple answer and I could probably keep digging around on Google before I stroll across the answer. But I am on a tight schedule and I was hoping for an easy re

3条回答
  •  日久生厌
    2021-01-26 04:00

    The similar as the sed solutons with perl

    perl -i.bak -pe 's/(ONBOOT)=no/$1=yes/;s/(BOOTPROTO)=dhcp/$1=static/' files....
    

提交回复
热议问题