I need some help with this script, the results are never found with the grep within the do loop:
#!/usr/bin/ksh
IFS=":"
>/usr/local/ticket_tool/logs/log.batchrun.issues
cat /usr/local/ticket_tool/logs/log.batchrun | grep "^Mailed" | sort -u -t " " +6 | cut -d" " -f6-20 | awk '{ FS=":" }{ OV="\042"$0"
$\042"":" }{ printf OV }' > /usr/local/ticket_tool/logs/log.batchrun.issues
for REPORT in `cat /usr/local/ticket_tool/logs/log.batchrun.issues`
do
#echo $X $CNT
CNT=$(expr $CNT + 1)
echo "`cat /usr/local/ticket_tool/logs/log.batchrun | grep -c ${REPORT} ` ERRORS."
done
~
I assume its a white space or unknown character in place of the spaces.
if I echo $REPORT on the screen, it looks correct...
#!/usr/bin/ksh
IFS=":"
>/usr/local/ticket_tool/logs/log.batchrun.issues
cat /usr/local/ticket_tool/logs/log.batchrun | grep "^Mailed" | sort -u -t " " +6 | cut -d" " -f6-20 | awk '{ FS=":" }{ OV="\042"$0"
$\042"":" }{ printf OV }' > /usr/local/ticket_tool/logs/log.batchrun.issues
for REPORT in `cat /usr/local/ticket_tool/logs/log.batchrun.issues`
do
#echo $X $CNT
CNT=$(expr $CNT + 1)
echo "`cat /usr/local/ticket_tool/logs/log.batchrun | grep -c ${REPORT} ` ERRORS."
done
~
I assume its a white space or unknown character in place of the spaces.
if I echo $REPORT on the screen, it looks correct...