Shell 字符串处理、获取文件名和后缀名

【http://www.lichaozheng.info/2012/03/20/shell-获取文件名和后缀名/】 代码: file=”thisfile.txt” echo “filename: ${file%.*}” echo “extension: ${file##*.}” 输出: filename: thisfile extension: txt 附: Bash字符串处理 基于Pattern
相关文章
相关标签/搜索