diff options
-rwxr-xr-x | scripts/binutils-version.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh index d4d9eb4..0bc26cf 100755 --- a/scripts/binutils-version.sh +++ b/scripts/binutils-version.sh @@ -14,7 +14,9 @@ if [ ${#gas} -eq 0 ]; then exit 1 fi -MAJOR=$($gas --version | head -1 | awk '{print $NF}' | cut -d . -f 1) -MINOR=$($gas --version | head -1 | awk '{print $NF}' | cut -d . -f 2) +version_string=$($gas --version | head -1 | sed -e 's/.*) *\([0-9.]*\).*/\1/' ) + +MAJOR=$(echo $version_string | cut -d . -f 1) +MINOR=$(echo $version_string | cut -d . -f 2) printf "%02d%02d\\n" $MAJOR $MINOR |