Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with AWK

Status
Not open for further replies.

Montavon

Programmer
Nov 3, 2001
3
US
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...
 
Pls post a snippet from the original file AND a desired result
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top