var="aa bb cc aa bb cc" echo "${var#a* b*}" echo "${var##a* b*}" echo "${var%c*}" echo "${var%%c*}" echo "${var/a b/eee}" echo "${var//a b/eee}" echo "${var/a b/}" echo "${#var}"
Tendrá como salida:
b cc aa bb cc aa bb cc aa bb c aa bb aeeeb cc aa bb cc aeeeb cc aeeeb cc ab cc aa bb cc 17