I want to run this awk statement from inside a shell script:
awk -F, '$45==341 && $47==341 && ($13==3) && $15 <=600 && $48==5410 && $50=="pattern"' \
full_path/logfile.log | cut -d, -f15 | sort -unr |head -1
If I run it directly from command line, it works perfectly but from inside a shell script it fails.
I understand there's an issue with shell script command line parameters and awk references, like $45
, $47
and so on...
I tryed to escape $
without success.