hor*_*ude 19 grep regex regular-expressions
我见过几个人这样做的例子:
grep [f]oobar
Run Code Online (Sandbox Code Playgroud)
但我不明白为什么这比
grep foobar
Run Code Online (Sandbox Code Playgroud)
Jef*_*and 33
没有理由单独使用更可取的语法。它有时在“grepping”进程(例如,ps aux | grep [a]pache
)时用作黑客。使用该语法可防止 grep 在进程列表中匹配其自己的命令行。