Get rid of prefix/suffix bash
Sometimes a dude just needs to get rid of a prefix or a suffix:
string=some_database-file.sql
suffix=.sql
stuff=${string%$suffix}
echo $stuff
get rid of prefix using ‘#’: ${string#$prefix}
get rid of suffix using ‘%’: ${string%$prefix}