Shell获取文件后缀名

file = "thisfile.txt"  
echo "filename: ${file%.*}" 
echo "extension: ${file##*.}"  

 

posted on 2014-02-28 14:40  Xavierr  阅读(613)  评论(0编辑  收藏  举报