Bash Parameter Expansion:
*
Delete a pattern from the end of a string
Shortest match:
$ a='I am a string'
$ echo "${a%a*}"
I am
Longest match:
$ echo "${a%%a*}"
I