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

5 lines
237 B
Bash
Raw Normal View History

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