I found out that with ${string:0:3} one can access the first 3 characters of a string. Is there a equivalently easy method to access the last three characters?
${string:0:3}
You can use tail:
tail
$ foo="1234567890" $ echo -n $foo | tail -c 3 890
A somewhat roundabout way to get the last three characters would be to say:
echo $foo | rev | cut -c1-3 | rev