blob: 0dc33cbb0912b1e601955b1ae33cbf732a706154 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
export LANG=en_US.UTF-8
a=$'\303\251'
echo "$a"
echo ${#a}
b=$'A\303\251B'
echo "$b"
echo ${b: -1}
c=AeB
echo ${c: -1}
unset a
a=$(printf '%b' 'A\303\251B')
IFS=$(printf '%b' '\303\251')
case "$a" in
"A${IFS}B") echo ok 1 ;;
*) echo bad 1 ;;
esac
set $a
case $1 in
A) echo ok 2 ;;
*) echo bad 2 ;;
esac
set a b
printf '%s\n' "$*"
printf '%s' "$*" | od -b
|