我喜欢perl做一个像单线一样的 grep
有点像这样,但我不知道要添加什么来使它工作
$ (echo a ; echo b ; echo c) | perl -e 'a'
Run Code Online (Sandbox Code Playgroud)
添加我在这里的答案涵盖了更多
https://superuser.com/questions/416419/perl-for-matching-with-regex-in-terminal
Eug*_*ash 28
(echo a; echo b; echo c) | perl -ne 'print if /a/'
Run Code Online (Sandbox Code Playgroud)
回应暴民的评论:
如果您想使用Perl正则表达式,请尝试ack:http://betterthangrep.com/
| 归档时间: |
|
| 查看次数: |
13420 次 |
| 最近记录: |