Shell中直接调用perl命令

The  -e option is handy for quick Perl operations from the command line. Want to change all instances of "oldstring" in Wiffle.bat to "newstrong"? Try

 

 

 

This says: "Take each line of  Wiffle.bat (-p); store the original in Wiffle.old (-i); substitute all instances of  oldstring with newstrong (-e); write the result (-p) to the original file (-i)."

 

Other PERL command line options are:

 

 

 Perl 5 Command-Line Switches

 

OptionArguments PurposeNotes
-0octal character codeSpecify record separator Default is newline (/n)
-anoneAutomatically spli recordst Used with -n or or -p
-cnoneCheck syntax onlyDo not execute
-dnoneRun script using Perl debugger If Perl debugging option was included when Perl was installed
-DflagsSpecify debugging behavior See table 2
-ecommandPass a command to Perl from the command line Useful for quick operations
-Fregular expressionIf -a used Expression to split by default is white space
-iextensionReplace original file with results Useful for modifying contents of files
-IdirectorySpecify location of include files  
-loctal character codeDrop newlines when used With -n and -p and use designated character as line- termination character
-nnoneProcess the script using each specified file as an argument Used for performing the same set of actions on a set of files
-pnoneSame as -n but each line is printed  
-PnoneRun the script through the C preprocessor before Perl compiles it  
-snoneEnable passing of arbitrary switches to Perl Use -s -what -ever to have the Perl variables $what and $ever defined within your script
-SnoneTell Perl to look along the path for the script  
-TnoneUse taint checking; don't evaluate expressions supplied on the command line  
-unoneMake Perl dump core after compiling your script; intended to allow for generation of Perl executables Very messy; wait for the Perl compiler
-UnoneUnsafe mode; overrides Perl's natural caution Don't use this!
-vnonePrint Perl version number  
-wnonePrint warnings about script syntax Extremely useful, especially during development  

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值