linux-tutorial/codes/shell/示例脚本/查找替换文本/sed/测试.sh

5 lines
229 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
#测试如果测试成功如果没有标签sed会跳转到结尾如果有标签就跳转到标签如果测试失败则不会跳转
sed -n '{s/first/matched/; t; s/This is the/No match on/}' test