#!/bin/bash
OLDIFS=$IFS
string=$1
IFS='.'
string_array=($string)
len=$(( ${#string_array[@]} - 1 ))
IFS=$OLDIFS
echo ${string_array[$len]}
exl@exl-Lenovo-G560e:~/SandBox > ./token.sh ..log.f
f
exl@exl-Lenovo-G560e:~/SandBox > ./token.sh .log.ccc
ccc
exl@exl-Lenovo-G560e:~/SandBox > ./token.sh log.qwerty
qwerty