D1483.check-rlfunc-decode-error.sh (335B)
1 #!/usr/bin/env bash 2 3 echo "----------" 4 echo "locale" 5 locale 6 7 echo "----------" 8 echo "test regex (default locale)" 9 10 rex='^"([^\"]|\\.)*$' 11 [[ $'"\x9B": self-insert' =~ $rex ]] 12 echo "$? (${BASH_REMATCH[*]@Q})" 13 14 echo "----------" 15 echo "test regex (locale C)" 16 17 LC_ALL=C 18 [[ $'"\x9B": self-insert' =~ $rex ]] 19 echo "$? (${BASH_REMATCH[*]@Q})"