linux-tutorial/codes/shell/查找替换文本/sed/测试.sh
2019-10-29 18:22:19 +08:00

5 lines
237 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
#测试如果测试成功如果没有标签sed会跳转到结尾如果有标签就跳转到标签如果测试失败则不会跳转
sed -n '{s/first/matched/; t; s/This is the/No match on/}' test