I am having trouble finding the last occurrence of a string in a file using awk. I pass the string to the example script "Ping Error for hostname". I keep getting awk: ^ unterminated string. #! / Bin / w
LOG=/opt/netcool/omnibus/log/mttrapd.log TMP_FILE=sitescope.$$ args="$*" #ruby sitescope.rb echo "looking for $1 " tail -1000 $LOG > $TMP_FILE echo "WORD = $args" awk '"/'$args'/" {f=$0} END{print f}' $TMP_FILE > data.out rm -f $TMP_FILE
awk
mig0913 Feb 23 2018-12-18T00: 00Z
source share