########################################################### # patch_ss - Produce a CSV file showing the propagation of # all CTPs across every productline on a given # machine. # J. David Schronce - Mon Apr 30 15:31:45 CDT 2007 ########################################################### #set -xv outdir=/tmp/patches rm /$outdir/*Patches.csv outfile=/$outdir/Patch_compare.csv `date` > $outfile # Uses the 'patch_list' script to generate it's data files ./patch_list # build CSV cd /$outdir # Add Header header="" for filename in `ls *Patches.csv` do env=`echo $filename | cut -d"." -f1` pl=`echo $filename | cut -d"." -f2` header="$header, $env , $pl" done echo "$header" >> $outfile # Add patches for patchnum in `cat *Patches.csv | cut -d, -f2 | grep -v [a-z] | sed 's/ No Changes//g' | sort -u ` do line="" for filename in `ls *Patches.csv` do # Process productlines where the patch does not exist if [ `grep $patchnum $filename | wc -l` -eq 0 ]; then line="$line , ," else line="$line , `grep $patchnum $filename | head -1`" fi done echo ".\c" echo "$line" >> $outfile done echo "\n\n Your CTP report for `hostname` is in $outfile\n"