echo "aaa.bb.c" | rev | cut -d "." -f 1 | rev
# c