3 # Get version from header.
7 if [ ! -f "$HEADER" ]; then
8 echo "$SCRIPT: error: $HEADER does not exist" 1>&2
11 PAT_PREFIX
='^#define[[:space:]]+XOMBRERO_'
12 PAT_SUFFIX
='[[:space:]]+[0-9]+$'
13 MAJOR
=$
(egrep "${PAT_PREFIX}MAJOR${PAT_SUFFIX}" $HEADER | awk '{print $3}')
14 MINOR=$(egrep "${PAT_PREFIX}MINOR${PAT_SUFFIX}" $HEADER | awk '{print $3}')
15 PATCH=$(egrep "${PAT_PREFIX}PATCH${PAT_SUFFIX}" $HEADER | awk '{print $3}')
16 if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then
17 echo "$SCRIPT: error: unable to get version from $HEADER" 1>&2
20 echo $MAJOR.
$MINOR.
$PATCH |
tr -d '\n'