I have written the following lines to get the last character of a string:
str=$1 i=$((${#str}-1)) echo ${str:$i:1}
It works for abcd/
abcd/
Every answer so far implies the word "shell" in the question equates to Bash.
This is how one could do that in a standard Bourne shell:
printf $str | tail -c 1