$ {Var # * word}: it refers to the separator where word is $ var. From left to right, after finding the separator that matches for the first time, remove all characters on the left of the separator (including the separator ).
$ {Var ## * word}: The separator with the word as $ var. From left to right, find the last matched separator and remove the separator (including the separator) all characters on the left
$ {Var % word *}: The separator with the word as $ var. from the right to the left, after finding the separator for the first match, remove all characters on the right of the separator (including the separator ).
$ {Var % word *}: Specifies the separator where word is $ var. from right to left, after finding the last matched separator, remove the separator (including the separator) all characters on the right
This article comes from the blog "Let me be more hungry", please be sure to keep this source http://ufirst.blog.51cto.com/7628670/1432612