use*_*598 7 linux perl backticks
我试图使用反引号在Perl中运行Linux命令.它在我直接在Linux中运行时有效,但是当Perl通过反引号执行时,我收到此错误:
sh: -c: line 0: syntax error near unexpected token `>'
sh: -c: line 0: `(/src/storageUtil --diagnostic 2> >(tee >(cat >&2) >&1)) > log.txt'
Run Code Online (Sandbox Code Playgroud)
有问题的代码行是:
$output = `(/src/storageUtil --diagnostic 2> >(tee >(cat >&2) >&1)) > log.txt`;
Run Code Online (Sandbox Code Playgroud)
任何可能导致此错误的见解都将非常感激.
谢谢