$ > STRING=this_test_string $ > echo ${STRING##*_} string $ > DIR=/home/user1/test $ > echo ${DIR##*/} test