thanks guys, If you get a chance, would you be able to explain to me what exactly is happening with these two commands
echo "${var%"${var#*z}"}"
sed 's/\(.*z\).*/\1/'
the var% is somewhat confusing and with regards to the second snippet, why is the "1" at the end... Thank you for posting those, if theres any way youd be able to explain them that would be great