last char of string bash code example
Example: shell substring last characters
echo -n $str | tail -c 1
# gets the last character, increase number to get more characters
echo -n $str | tail -c 1
# gets the last character, increase number to get more characters