Я получаю сообщение об ошибке при чтении файла, а ниже приведен сценарий.
#!/bin/bash
$file = "SampleLogFile.txt"; #--- line 2
open(MYINPUTFILE,$file); #--- line 3
while(<**MYINPUTFILE**>) {
# Good practice to store $_ value because
# subsequent operations may change it.
my($line) = $_;
# Good practice to always strip the trailing
# newline from the line.
chomp($line);
# Convert the line to upper case.
print "$line" if $line = ~ /sent/;
}
close (MYINPUTFILE);
Вывод:
PerlTesting_New.ksh[2]: =: not found
PerlTesting_New.ksh[3]: синтаксическая ошибка в строке 3: `(' неожиданно
Есть идеи, в чем проблема?