# $Id$ check_version() { : <&1 >/dev/null || echo $tst_version | grep [[:alpha:]] 2>&1 >/dev/null ;then echo "Cannot test for text, 0.0.0a, version types, assuming 'success' " return fi write_error_and_die() { echo -e "\n\t\t$TXT version -->${tst_version}<-- is too old. This script requires ${ref_version} or greater\n" exit 1 } echo -ne "$TXT:\t<${tst_version}>" IFS=".-(" # Split up w.x.y.z as well as w.x.y-rc (catch release candidates) set -- $ref_version # set postional parameters to minimum ver values ref_major=$1; ref_minor=$2; ref_revision=$3 # set -- $tst_version # Set postional parameters to test version values major=$1; minor=$2; revision=$3 # # Compare against minimum acceptable version.. (( major > ref_major )) && echo " ..OK" && return (( major < ref_major )) && write_error_and_die # major=ref_major (( minor < ref_minor )) && write_error_and_die (( minor > ref_minor )) && echo " ..OK" && return # minor=ref_minor (( revision >= ref_revision )) && echo " ..OK" && return # oops.. write error msg and die write_error_and_die }