busybox/shell/ash_test/ash-quoting/bkslash_case1.tests
Denys Vlasenko 8de5b9f88b ash : fix double-quoted "\z" handling
function                                             old     new   delta
readtoken1                                          2602    2608      +6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2018-02-13 14:44:11 +01:00

39 lines
549 B
Plaintext
Executable File

# Case argument is globbed, match patterns are not.
# This caught some bugs in the past.
case z in
\z ) echo ok1 ;;
* ) echo BUG ;;
esac
case \z in
z ) echo ok2 ;;
* ) echo BUG ;;
esac
case \z in
\z ) echo ok3 ;;
* ) echo BUG ;;
esac
case z in
\z ) echo ok4 ;;
* ) echo BUG ;;
esac
case \\z in
\\z ) echo ok5 ;;
* ) echo BUG ;;
esac
echo Ok:$?
case "\z" in
"\z" ) echo ok6 ;;
* ) echo BUG ;;
esac
case "\\z" in
"\\z" ) echo ok7 ;;
* ) echo BUG ;;
esac
case "\\\z" in
"\\\z") echo ok8 ;;
* ) echo BUG ;;
esac
echo Ok:$?