View
@@ -0,0 +1,27 @@
#!/bin/bash
# Hm this changes everything -- exit code is 1!
#set -o errexit
# Inspired by sources/download_functions.sh in Aboriginal:
# wget -t 2 -T 20 -O "$SRCDIR/$FILENAME" "$1" ||
# (rm -f "$SRCDIR/$FILENAME"; return 2)
# This also causes a warning, but is not fatal.
# bash gives a warning but mksh doesn't.
echo SUBSHELL
false || (rm -f foo; return 2)
echo BREAK
break
echo CONTINUE
continue
echo RETURN
# dash returns, bash warns that it's invalid.
# mksh returns.
return # This is like exit?
# Bash gets here.
echo DONE
View
@@ -344,7 +344,7 @@ here-doc() {
# - On Debian, the whole process hangs.
# Is this due to Python 3.2 vs 3.4? Either way osh doesn't implement the
# functionality, so it's probably best to just implement it.
sh-spec spec/here-doc.test.sh --osh-failures-allowed 3 --range 0-30 \
sh-spec spec/here-doc.test.sh --osh-failures-allowed 2 --range 0-30 \
${REF_SHELLS[@]} $OSH "$@"
}
@@ -411,6 +411,11 @@ sh-options() {
${REF_SHELLS[@]} $OSH "$@"
}
strict-options() {
sh-spec spec/strict-options.test.sh \
${REF_SHELLS[@]} $OSH "$@"
}
errexit() {
sh-spec spec/errexit.test.sh \
${REF_SHELLS[@]} $BUSYBOX_ASH $OSH "$@"