From 8925419e90123e5432e9a84ddd90a5f186e4d420 Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Fri, 21 Feb 2014 19:21:03 +1000 Subject: [PATCH] tests: avoid reliance on nullglob Some shells do not have a nullglob feature, including dash (default /bin/sh on Ubuntu) and the Almquist shell (default /bin/sh on FreeBSD). An mv(1) command in setup_dir is failing due to a glob not matching anything, so use a more widely supported construction. --- test/fast/setup_dir | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/fast/setup_dir b/test/fast/setup_dir index 75e67e3..64e097c 100755 --- a/test/fast/setup_dir +++ b/test/fast/setup_dir @@ -5,8 +5,9 @@ # Back up - type setopt >/dev/null 2>&1 && setopt NULL_GLOB - type shopt >/dev/null 2>&1 && shopt -s nullglob mkdir -p bak - mv v* src alias bak || sleep 0s + for SRC in v* src alias; do + [ -e "$SRC" ] && mv "$SRC" bak + done + true )