x="CHIP.cdl"
x_list=(`echo $x | tr '.' ' '`)
export suffix=${x_list[$((${#x_list[@]}-1))]}
export top=${x_list[$((${#x_list[@]}-2))]}
echo $suffix
cdl
echo $top
CHIP
x="CHIP.cdl"
x_list=(`echo $x | tr '.' ' '`)
export suffix=${x_list[$((${#x_list[@]}-1))]}
export top=${x_list[$((${#x_list[@]}-2))]}
echo $suffix
cdl
echo $top
CHIP