2009-04-10 04:31:47 +05:30
|
|
|
unset var
|
|
|
|
|
2009-04-11 05:18:03 +05:30
|
|
|
echo Empty:${var#}
|
|
|
|
echo Empty:${var##}
|
|
|
|
echo Empty:${var#*}
|
|
|
|
echo Empty:${var##*}
|
|
|
|
echo Empty:${var%}
|
|
|
|
echo Empty:${var%%}
|
|
|
|
echo Empty:${var%*}
|
|
|
|
echo Empty:${var%%*}
|
2009-04-10 04:31:47 +05:30
|
|
|
|
|
|
|
var=
|
|
|
|
|
2009-04-11 05:18:03 +05:30
|
|
|
echo Empty:${var#}
|
|
|
|
echo Empty:${var##}
|
|
|
|
echo Empty:${var#*}
|
|
|
|
echo Empty:${var##*}
|
|
|
|
echo Empty:${var%}
|
|
|
|
echo Empty:${var%%}
|
|
|
|
echo Empty:${var%*}
|
|
|
|
echo Empty:${var%%*}
|
2009-04-10 04:31:47 +05:30
|
|
|
|
2009-04-07 11:33:22 +05:30
|
|
|
var=ababcdcd
|
|
|
|
|
|
|
|
echo ${var#ab}
|
|
|
|
echo ${var##ab}
|
|
|
|
echo ${var#a*b}
|
|
|
|
echo ${var##a*b}
|
|
|
|
echo ${var#?}
|
|
|
|
echo ${var##?}
|
|
|
|
echo ${var#*}
|
2009-04-11 05:18:03 +05:30
|
|
|
echo Empty:${var##*}
|
2009-04-19 19:27:51 +05:30
|
|
|
echo ${var#}}_tail
|
|
|
|
# UNFIXED BUG: echo ${var#\}}_tail
|
2009-04-07 11:33:22 +05:30
|
|
|
|
|
|
|
echo ${var%cd}
|
|
|
|
echo ${var%%cd}
|
|
|
|
echo ${var%c*d}
|
|
|
|
echo ${var%%c*d}
|
|
|
|
echo ${var%?}
|
|
|
|
echo ${var%%?}
|
|
|
|
echo ${var%*}
|
2009-04-11 05:18:03 +05:30
|
|
|
echo Empty:${var%%*}
|
2009-04-19 19:27:51 +05:30
|
|
|
echo ${var#}}_tail
|
|
|
|
# UNFIXED BUG: echo ${var#\}}_tail
|
2009-04-26 16:55:19 +05:30
|
|
|
echo ${var%\\*}
|
2009-04-07 11:33:22 +05:30
|
|
|
|
|
|
|
echo end
|