[BUG] 'case' does not match double-quoted backslash
Martijn Dekker
martijn at inlv.org
Mon Feb 12 21:36:59 UTC 2018
The following outputs BUG in ash:
case "\z" in
"\z" ) echo ok ;;
* ) echo BUG ;;
esac
Apparently `case` has trouble matching the "\z" pattern due to the
backslash within the double quotes. Quoting it in any other way works.
Also, backslash-escaping the backslash within the double quotes is a
workaround. But this is not supposed to be necessary unless the
backslash precedes one of the special characters $, `, ", \, or <newline>.
The bug is in 1.28.0 but not 1.27.0.
According to my testing, this bug appears to have been introduced by
this commit, which fixed another related bug.
| commit fda9fafe279d9394ad53313320a949c86f646734
| Author: Denys Vlasenko <vda.linux at googlemail.com>
| Date: Wed Jul 5 19:10:21 2017 +0200
|
| ash: fix matching of unicode greek letter rho (cf 81) and similar
cases
|
| Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
Thanks,
- M.
More information about the busybox
mailing list