我想在bash脚本中执行类似下面的操作.我如何在bash语法中实现.
if !((a==b) && (a==c))
then
do something
end if
Run Code Online (Sandbox Code Playgroud) 我需要帮助使用sed来评论匹配的行和它后面的4行.在文本文件中.
我的文本文件是这样的:
[myprocess-a]
property1=1
property2=2
property3=3
property4=4
[anotherprocess-b]
property1=gffgg
property3=gjdl
property2=red
property4=djfjf
[myprocess-b]
property1=1
property4=4
property2=2
property3=3
Run Code Online (Sandbox Code Playgroud)
我希望在所有带有文本'[myprocess'的行和前面有4行的预期输出前面加上#:
#[myprocess-a]
#property1=1
#property2=2
#property3=3
#property4=4
[anotherprocess-b]
property1=gffgg
property3=gjdl
property2=red
property4=djfjf
#[myprocess-b]
#property1=1
#property4=4
#property2=2
#property3=3
Run Code Online (Sandbox Code Playgroud)
非常感谢您对此的帮助.