summaryrefslogtreecommitdiff
path: root/shell/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'shell/common.sh')
-rw-r--r--shell/common.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/common.sh b/shell/common.sh
index 6866f0be..ab4b3d70 100644
--- a/shell/common.sh
+++ b/shell/common.sh
@@ -22,11 +22,11 @@ __fzf_exec_awk() {
# modern point of view. To use a standard-conforming version in Solaris,
# one needs to explicitly use /usr/xpg4/bin/awk.
__fzf_awk=/usr/xpg4/bin/awk
- else
+ elif command -v mawk >/dev/null 2>&1; then
# choose the faster mawk if: it's installed && build date >= 20230322 &&
# version >= 1.3.4
local n x y z d
- IFS=' .' read n x y z d <<< $(command mawk -W version 2> /dev/null)
+ IFS=' .' read -r n x y z d <<< $(command mawk -W version 2> /dev/null)
[[ $n == mawk ]] && (( d >= 20230302 && (x * 1000 + y) * 1000 + z >= 1003004 )) && __fzf_awk=mawk
fi
fi