Don*_*Bit 0 shell-script text-processing
我想修改配置文件,如下图。作为 shell 脚本我可以做什么?
Section "InputClass"
Identifier "calibration"
MatchProduct "Touch"
Option "Calibration" "166 3939 186 3814"
Option "SwapAxes" "1"
Option "InvertX" "on"
Option "InvertY" "on"
EndSection
Run Code Online (Sandbox Code Playgroud)
Section "InputClass"
Identifier "calibration"
MatchProduct "Touch"
Option "Calibration" "166 3939 186 3814"
Option "SwapAxes" "1"
Option "InvertX" "off"
Option "InvertY" "on"
EndSection
Run Code Online (Sandbox Code Playgroud)
甚至
sed -i '/InvertX/s/"on"/"off"/' file_name
Run Code Online (Sandbox Code Playgroud)