【发布时间】:2020-05-16 20:12:20
【问题描述】:
编写 perl 脚本是为了发送数据。 它正在抛出异常:
-e 第 1 行的语法错误,在 EOF 执行 -e 因以下原因中止 编译错误。
代码:
patln=`awk -v dat="$dt" '$0 ~ dat {print NR}' *path of the file where the logs are present*| head -1`
STATUS=$( perl -ne "print if $. >= $patln" *path of the file where the logs are present* | grep TABLE
【问题讨论】:
-
显示的代码有一个不平衡的括号,
*path of the file where the logs are present*不是真的存在,是吗?贴出真实代码。 -
尝试在 perl 代码周围使用单引号而不是双引号?
-
我尝试使用单引号..没有帮助。
-
是的,日志文件存在。
-
如何计算变量
$pathln?如果将 Perl 脚本替换为perl -ne "print" ...是否还会出现语法错误?