From https://askubuntu.com/questions/89995/bash-remove-first-and-last-characters-from-a-string?newreg=53bbf9631d844d3686c570f714833496
string="|abcdefg|" echo "${string//|/}"