summaryrefslogtreecommitdiffhomepage
path: root/shell/hush_test/hush-vars/var_posix1.tests
blob: d3205b119d6c3c584dde383658667f936a1a1a8a (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
39
40
41
42
43
unset var

echo ${var#}
echo ${var##}
echo ${var#*}
echo ${var##*}
echo ${var%}
echo ${var%%}
echo ${var%*}
echo ${var%%*}

var=

echo ${var#}
echo ${var##}
echo ${var#*}
echo ${var##*}
echo ${var%}
echo ${var%%}
echo ${var%*}
echo ${var%%*}

var=ababcdcd

echo ${var#ab}
echo ${var##ab}
echo ${var#a*b}
echo ${var##a*b}
echo ${var#?}
echo ${var##?}
echo ${var#*}
echo ${var##*}

echo ${var%cd}
echo ${var%%cd}
echo ${var%c*d}
echo ${var%%c*d}
echo ${var%?}
echo ${var%%?}
echo ${var%*}
echo ${var%%*}

echo end