Đây là mã của tôi:"BEGIN khối phải có một bộ phận không hành động" lỗi trong script awk
#!/bin/sh
filename=$(/usr/bin/find -name "INSTANCE-*.log")
echo "filename is " $filename
awk '
BEGIN
{
print "Processing file: " filename
}
{
if($0 ~ /Starting/)
{
print "The bill import has been Started on "$1 " " $2
}
}' $filename > report.txt
Khi tôi thực hiện nó tôi nhận được lỗi sau:
BEGIN blocks must have an action part
BEGIN
khối của tôi có một print
tuyên bố để nó có một phần hành động. Tôi đang thiếu gì ở đây?