@cryptotaxi247 / kubo / commits / 6cc0a6b1d

test/bin: fix continueyn on Linux

It looks like there were two problems: - "read" command probably needs the name of the variable it reads into - [[ didn't work This might be because on Linux /bin/sh is sometimes not bash. For example on Ubuntu it is a symlink to dash. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>

Christian Couder committed Mar 16, 2015 at 20:02 UTC 6cc0a6b1dee5362665f78c556f1d7f44ba5811bd
1 file changed +5 -5
test/bin/continueyn
+5 -5
@@ -5,9 +5,9 @@
5 # if not a terminal, exit 0 (yes!)
6 test -t 1 || exit 0
7
8 -read -p "continue? [y/N] "
8 +read -p "continue? [y/N] " REPLY
9 echo
10 -if [[ $REPLY =~ ^[Yy] ]]; then
11 - exit 0
12 -fi
13 -exit 1
10 +case "$REPLY" in
11 + [Yy]*) exit 0 ;;
12 + *) exit 1 ;;
13 +esac