sed命令中的逗号代表什么?

Roo*_*asa 5 sed

以下命令是什么意思:

sed -e '/SUBCKT\ REDBK128S4_LC/,/ENDS/ d'   $1 
Run Code Online (Sandbox Code Playgroud)

代表什么,

Mar*_*ell 7

它指定要RANGE在其上应用d命令的位置。

可以使用以下模式指定范围:

sed -e '/START/,/END/ command'    # apply command on lines between START and END pattern
Run Code Online (Sandbox Code Playgroud)

或像这样的行号:

sed -e '1,35 command'    # apply command on lines 1 to 35
Run Code Online (Sandbox Code Playgroud)

或混合使用,例如:

sed '1200,$ {/abc/ command}'     # apply command on lines 1200 to end of file that contain "abc"
Run Code Online (Sandbox Code Playgroud)


sat*_*sat 6

如果指定两个地址,则指定执行命令的行范围。在您的sed表达式中,它将删除所有从第一个模式匹配的行开始直到第二个模式匹配的行的行。