【发布时间】:2023-04-03 07:14:01
【问题描述】:
我正在尝试通过 Perl 脚本将输出和错误重定向到 Unix 中的文件。
该命令在 Unix 中运行良好,但在运行 Perl 脚本时抛出错误 sh: & is unexpected。我也尝试使用转义字符
命令:
`ls -lrt $myfile >>& $output`
也用过命令:
`ls -lrt $myfile >> $output 2>&1` - got ambiguous output redirect error
【问题讨论】:
-
你想完成什么?无论如何,您尝试做的事情很有可能最好在 perl 中本地完成。
-
我正在尝试将 unix 命令的输出和错误重定向到 perl 脚本内的文件中
标签: perl unix sh perl-module mod-perl