My script is:
#!/usr/bin/perl -w
my $line="1 2 3 4 5 6 7";
print $line;
my $thirdlast=`print $line |awk '{print $(NF-3)}'`;
print $thirdlast;
The output is:
1 2 3 4 5 6 7 awk: 0602-542 There is an extra ) character.
The source line is 1.
The error context is
{print 201 1 >>> 201NF-3) <<<
Syntax Error The source line is 1.
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
awk: 0602-542 There is an extra ) character.
What is it complaining about? Anything wrong with my script? Couldn't understand why it says The source line is 1
.
What fix is needed by my script?