[英]Using wildcard characters while running system command in Perl Script
在Perl脚本中运行系统命令时如何使用通配符。 例如,使用* .src使用sed编辑文件-类似于:
system("sed -i -e 's/foo/bar/g' $baseDirPath/*.src");
它给出了一个错误: sed: can't read /home/test/*.src: Not a Directory
在这里,$ baseDirPath初始化为/ home / test
在使用变量$baseDirPath
之前,请尝试使其$baseDirPath
,因为您编写的行应该可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.