#!/bin/bash
[ "$2" == "" ] && exec echo "Usage: $0 <UpgradeErrorReport.txt> <SET_ID> <XLUSERID>"

FILENAME=$1
SET_ID=$2
XLUSERID=$3
DATE=$(date +"%Y%m%d")

OUTPUT="/tmp/cf_s${SET_ID}_${XLUSERID}_${DATE}.log"

cat ${FILENAME} | grep 'TryCount' | awk -F" " '{print $NF}' | sort | uniq | awk -F":" '{print $2}' > ${OUTPUT}
echo ${OUTPUT}
cat ${OUTPUT}
