shell获取文件名和缀

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
陕ICP备20000710号
本站已运行15年4月22天
发表了391篇文章 · 总计13万8千字
Built with Hugo
Theme Stack designed by Jimmy