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/
Per @perreal, quoting variables is important, but because I read this post like 5 times before finding a simpler approach to the question at hand in the comments...
str='abcd/'
echo "${str: -1}"
Output: /
str='abcd*'
echo "${str: -1}"
Output: *
Thanks to everyone who participated in this above; I've appropriately added +1's throughout the thread!