简体   繁体   English

如何将参数传递给 perl 脚本

[英]How to pass an argument to a perl script

 my @return = `at now +3 days -f test2.pl myargument 2>&1`;

How do I pass that myargument to my script test2.pl?我如何将该 myargument 传递给我的脚本 test2.pl? In that code it returns an error.在该代码中,它返回一个错误。

According to the documentation for at on my system, it reads bourne shell commands to be executed from from the file specified with -f or STDIN.根据我系统上的at文档,它读取要从-f或 STDIN 指定的文件中执行的 bourne shell 命令。

As such, the following should do the trick:因此,以下应该可以解决问题:

`printf %s 'test2.pl myargument' | at now +3 days 2>&1`;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM