Don't assign the return of print, just assign the value of the index array element:
But why not just use Perl's awk mode instead?my $field = $fields[0]; print "$field\n";
echo '2014-06-04T15:24:21-05:00 syslog_dp [0x80e00099][ftp][error] sec +ure-backup(FBB): trans(5487)' | perl -lape '$_=$F[0]'
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re^4: Simple awk question
by jeffa
in thread Simple awk question
by czah7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |