########################################## # filedef.sh - generate the file definitions for a complete productline #J. David Schronce - 2005 Jun 29 ########################################## ## Get list of productlines echo "\nPruductlines in $LAWENVNAME" echo "GEN" > /tmp/expfile.$$ rngdbdump -nt gen prodline -f productline | grep -v GEN >> /tmp/expfile.$$ pr -n -t /tmp/expfile.$$ 2> /dev/null | more -e echo "\n\nEnter Choice > <\b\b\c" read ans2 PL=`sed -n "$ans2 p" /tmp/expfile.$$ 2> /dev/null` rm /tmp/expfile.$$ > /tmp/$PL.filedef.csv case $PL in [Gg][Ee][Nn]) count gen | cut -d" " -f1 > /tmp/filedef.list.$$;; *) rngdbdump -cnt gen filedef -f PRODUCTLINE FILENAME | grep -i \"$PL\" | cut -d"," -f2 | sed 's/"//g' > /tmp/filedef.list.$$;; esac echo "Processing all datafiles in $PL .." sleep 3 for filename in `cat /tmp/filedef.list.$$` do echo $filename dbdesc $PL ${filename} | tail +7 | awk '{print $1"," $6}' > /tmp/filedef.out outstring="$filename" while read line do outstring="$outstring , $line" done < /tmp/filedef.out rm /tmp/filedef.out echo $outstring >> /tmp/$PL.filedef.csv done rm /tmp/filedef.list.$$ echo "File Definitions are in /tmp/$PL.filedef.csv"