blob: 3069360e1539110b0a0b2f31d91a3f49920337c3 [file] [log] [blame]
Mike Frysingere05f9282009-04-09 23:01:47 +00001unset var
2
Denis Vlasenko75bccfa2009-04-10 23:48:03 +00003echo Empty:${var#}
4echo Empty:${var##}
5echo Empty:${var#*}
6echo Empty:${var##*}
7echo Empty:${var%}
8echo Empty:${var%%}
9echo Empty:${var%*}
10echo Empty:${var%%*}
Mike Frysingere05f9282009-04-09 23:01:47 +000011
12var=
13
Denis Vlasenko75bccfa2009-04-10 23:48:03 +000014echo Empty:${var#}
15echo Empty:${var##}
16echo Empty:${var#*}
17echo Empty:${var##*}
18echo Empty:${var%}
19echo Empty:${var%%}
20echo Empty:${var%*}
21echo Empty:${var%%*}
Mike Frysingere05f9282009-04-09 23:01:47 +000022
Mike Frysingera4f331d2009-04-07 06:03:22 +000023var=ababcdcd
24
25echo ${var#ab}
26echo ${var##ab}
27echo ${var#a*b}
28echo ${var##a*b}
29echo ${var#?}
30echo ${var##?}
31echo ${var#*}
Denis Vlasenko75bccfa2009-04-10 23:48:03 +000032echo Empty:${var##*}
Denis Vlasenkobf25fbc2009-04-19 13:57:51 +000033echo ${var#}}_tail
34# UNFIXED BUG: echo ${var#\}}_tail
Mike Frysingera4f331d2009-04-07 06:03:22 +000035
36echo ${var%cd}
37echo ${var%%cd}
38echo ${var%c*d}
39echo ${var%%c*d}
40echo ${var%?}
41echo ${var%%?}
42echo ${var%*}
Denis Vlasenko75bccfa2009-04-10 23:48:03 +000043echo Empty:${var%%*}
Denis Vlasenkobf25fbc2009-04-19 13:57:51 +000044echo ${var#}}_tail
45# UNFIXED BUG: echo ${var#\}}_tail
Mike Frysingera4f331d2009-04-07 06:03:22 +000046
47echo end