Bash Extract Substring From Variable