Mike Frysinger | e05f928 | 2009-04-09 23:01:47 +0000 | [diff] [blame] | 1 | unset var |
2 | |||||
3 | echo ${var#} | ||||
4 | echo ${var##} | ||||
5 | echo ${var#*} | ||||
6 | echo ${var##*} | ||||
7 | echo ${var%} | ||||
8 | echo ${var%%} | ||||
9 | echo ${var%*} | ||||
10 | echo ${var%%*} | ||||
11 | |||||
12 | var= | ||||
13 | |||||
14 | echo ${var#} | ||||
15 | echo ${var##} | ||||
16 | echo ${var#*} | ||||
17 | echo ${var##*} | ||||
18 | echo ${var%} | ||||
19 | echo ${var%%} | ||||
20 | echo ${var%*} | ||||
21 | echo ${var%%*} | ||||
22 | |||||
Mike Frysinger | a4f331d | 2009-04-07 06:03:22 +0000 | [diff] [blame] | 23 | var=ababcdcd |
24 | |||||
25 | echo ${var#ab} | ||||
26 | echo ${var##ab} | ||||
27 | echo ${var#a*b} | ||||
28 | echo ${var##a*b} | ||||
29 | echo ${var#?} | ||||
30 | echo ${var##?} | ||||
31 | echo ${var#*} | ||||
32 | echo ${var##*} | ||||
33 | |||||
34 | echo ${var%cd} | ||||
35 | echo ${var%%cd} | ||||
36 | echo ${var%c*d} | ||||
37 | echo ${var%%c*d} | ||||
38 | echo ${var%?} | ||||
39 | echo ${var%%?} | ||||
40 | echo ${var%*} | ||||
41 | echo ${var%%*} | ||||
42 | |||||
43 | echo end |