1 2unset LC_ALL 3LC_CTYPE=en_US.UTF-8 4export LC_CTYPE 5 6c1=e 7# a umlaut 8c2=$(printf '\303\244') 9# euro sign 10c3=$(printf '\342\202\254') 11# some sort of 't' outside BMP 12c4=$(printf '\360\235\225\245') 13 14ok=0 15case $c1$c2$c3$c4 in 16*) ok=1 ;; 17esac 18if [ $ok = 0 ]; then 19 echo wrong at $LINENO 20 exit 3 21fi 22 23case $c1$c2$c3$c4 in 24$c1$c2$c3$c4) ;; 25*) echo wrong at $LINENO ;; 26esac 27 28case $c1$c2$c3$c4 in 29"$c1$c2$c3$c4") ;; 30*) echo wrong at $LINENO ;; 31esac 32 33case $c1$c2$c3$c4 in 34????) ;; 35*) echo wrong at $LINENO ;; 36esac 37 38case $c1.$c2.$c3.$c4 in 39?.?.?.?) ;; 40*) echo wrong at $LINENO ;; 41esac 42 43case $c1$c2$c3$c4 in 44[!a][!b][!c][!d]) ;; 45*) echo wrong at $LINENO ;; 46esac 47 48case $c1$c2$c3$c4 in 49[$c1][$c2][$c3][$c4]) ;; 50*) echo wrong at $LINENO ;; 51esac 52 53case $c1$c2$c3$c4 in 54["$c1"]["$c2"]["$c3"]["$c4"]) ;; 55*) echo wrong at $LINENO ;; 56esac 57