用途grep -F:
-F, --fixed-strings将PATTERN解释为由换行符分隔的固定字符串列表,其中任何一个都将被匹配。(
-F由POSIX指定。)
编辑:最初我对这个问题不太了解。如果模式本身包含换行符,请使用-z选项:
Run Code Online (Sandbox Code Playgroud)-z, --null-data Treat the input as a set of lines, each terminated by a zero byte (the ASCII NUL character) instead of a newline. Like the -Z or --null option, this option can be used with commands like sort -z to process arbitrary file names.
我已经测试过,多行模式有效。
小智 1
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by
newlines, any of which is to be matched. (-F is specified by
POSIX.)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1389 次 |
| 最近记录: |