Close #7 : use BASH_VERSINFO instead of janky version check

This commit is contained in:
2014-05-12 07:19:45 -07:00
parent f72240fd19
commit 1ba6694330

View File

@@ -1,8 +1,7 @@
#!/bin/bash
bashversion=$(${BASH} --version | head -n 1 | grep -o "version [0-9]" | cut -d ' ' -f 2)
if [ $bashversion -lt 4 ]; then
echo "cmdarg is incompatible with bash versions < 4.0, please upgrade bash" >&2
if (( BASH_VERSINFO[0] < 4 )); then
echo "cmdarg is incompatible with bash versions < 4, please upgrade bash" >&2
exit 1
fi