Bash Parameter Expansion Oct 3, 2008, 01 :32 UTC (0 Talkback[s]) (3181 reads) (Other stories by Mitch Frazier)
"There are also expansions for removing prefixes and suffixes. The form ${VAR#pattern} removes any prefix from the expanded value that matches the pattern. The removed prefix is the shortest matching prefix, if you use double pound-signs/hash-marks the longest matching prefix is removed. Similarily, the form ${VAR%pattern} removes a matching suffix..."