命令行参数转换为shell脚本转换?

时间:2014-07-23 15:04:40

标签: linux perl shell

我有一个命令行参数,我需要将其转换为shell脚本。有人能解释我怎么做到这一点?

如果它像下面那样简单,那么,如何在这里照顾较低和较高的情况?

cat * |perl -ne '{chomp; print "$_\n" if ($_=~ /MAR-|-MAR/|/JAN-|-JAN/|/FEB-|-FEB/|/APR-|-APR/|/MAY-|-MAY/|/JUN-|-JUN/|/JUL-|-JUL/|/AUG-|-AUG/|/SEPT-|-SEPT/|/OCT-|-OCT/|/NOV-|-NOV/|/DEC-|-DEC/|/dec-|-dec/|/Aug-|-Aug/|/Jan-|-Jan/|/Sept-|-Sept/)|/Feb-|-Feb/|/Mar-|-Mar/|/Apr-|-Apr/|/May-|-May/|/Jun-|-Jun/|/Jul-|-Jul/|/Oct-|-Oct/|/Nov-|-Nov/}'|more

1 个答案:

答案 0 :(得分:1)

要使测试用例不敏感,请添加i。例如:

 if ($something =~ /re/i) {