我希望perl可以像
grep
一样执行一行代码。类似于这个例子,但我不确定需要添加什么才能使其运行。$ (echo a ; echo b ; echo c) | perl -e 'a'
增补 我的回答涵盖了这个问题,还有更多。 https://superuser.com/questions/416419/perl-for-matching-with-regex-in-terminal
ack
(通过安装App::ack
发行版)。 - mob