############################################################# # env_versions.sh - build csv of environment programs for all # environments on this server # J. David Schronce ############################################################# TMP=/tmp # temporary workspace ############################################################# umask 000 if [ "X$1" != "X" ]; then TMP=$1 fi # Make sure $TMP exists if [ ! -d $TMP ]; then mkdir $TMP fi # Check that user is in an env if [ "X$LAWENVNAME" = "X" ]; then . cv fi # Remove any existing output files #rm $TMP/*.env.csv 2>/dev/null # cycle thru all environments for lawenv in `lstver | sort` do . cv $lawenv if [ -d $GENDIR/bin ]; then echo $LAWENVNAME envversion=`univver -V | cut -d: -f2 | cut -c 2-5` daate=`univver -V | cut -d")" -f2 | cut -c 2-4` cd $GENDIR/bin # remove 'awk' line below if you want timestamps for file in `find . -type f -print -prune` ; do univver $file 2> /dev/null \ | awk '{print $1, $2}' \ | sed "s/\.\///g" \ | sed "s/: / /g" \ | sed "s/ Version/,Version_Not_Found/g" \ | sed "s/ $envversion/,$envversion/g" 2> /dev/null \ | sed "s/ $daate/,$daate/g" 2> /dev/null \ >> $TMP/$LAWENVNAME.env.csv done fi done