var_posix1.tests 793 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. unset var
  2. echo Empty:${var#}
  3. echo Empty:${var##}
  4. echo Empty:${var#*}
  5. echo Empty:${var##*}
  6. echo Empty:${var%}
  7. echo Empty:${var%%}
  8. echo Empty:${var%*}
  9. echo Empty:${var%%*}
  10. var=
  11. echo Empty:${var#}
  12. echo Empty:${var##}
  13. echo Empty:${var#*}
  14. echo Empty:${var##*}
  15. echo Empty:${var%}
  16. echo Empty:${var%%}
  17. echo Empty:${var%*}
  18. echo Empty:${var%%*}
  19. var=ababcdcd
  20. echo ${var#ab}
  21. echo ${var##ab}
  22. echo ${var#a*b}
  23. echo ${var##a*b}
  24. echo ${var#?}
  25. echo ${var##?}
  26. echo ${var#*}
  27. echo Empty:${var##*}
  28. echo ${var#}}_tail
  29. echo ${var#\}}_tail
  30. echo ${var%cd}
  31. echo ${var%%cd}
  32. echo ${var%c*d}
  33. echo ${var%%c*d}
  34. echo ${var%?}
  35. echo ${var%%?}
  36. echo ${var%*}
  37. echo Empty:${var%%*}
  38. echo ${var#}}_tail
  39. echo ${var#\}}_tail
  40. echo ${var%\\*}
  41. a=ab}; echo ${a%\}};
  42. a=abc; c=c; echo ${a%${c}}
  43. a=ab{{c; echo ${a%`echo {{c`}
  44. echo End