In one project I'm working on, we need to keep the file with the largest build number. Here's a sample to check which build number is the latest one.
for file in `find . -name \*$ESBPREFIX\*.isvp`
do
# echo $file
NAMELENGTH=`expr length $file`
POSITION=`expr $NAMELENGTH - 7`
ESBVERSION=`expr substr $file $POSITION 3`
if [ `expr index $ESBVERSION "."` -eq 1 ]; then
ESBVERSION=`expr substr $ESBVERSION 2 2`
fi
if [ `expr index $ESBVERSION "."` -eq 2 ]; then
ESBVERSION=`expr substr $ESBVERSION 3 1`
fi
# echo "[CO Build Number: $ESBVERSION]"
if [ $ESBVERSION -gt $MAXESBBDNR ]; then
MAXESBBDNR=$ESBVERSION
fi
done
No comments:
Post a Comment