我想使用SED的AWK中的以下逻辑从文件中删除行:
例如:
$STRING_1="<<<EOT"
$STRING_2=">>>EOT"
$text="
First line, it will not be removed
Second line
<<<EOT
this block will be removed
including surrounding tags <<<EOT and >>>EOT
>>>EOT
this line will not be removed
<<<EOT
this block will be removed as well...
>>>EOT
End of file which will not be removed :)
"
程序运行应导致$text
等于以下值:
First line, it will not be removed
Second line
this line will not be removed
End of file which will not be removed :)