- 论坛徽章:
- 1
|
回复 33# Herowinter
我测试了,也可行!- #!/bin/bash
- ##this is pattern.sh
- pattern=`awk '{for(i=1;i<=length($0);i++){c=substr($0,i,1);if(c~/[A-Za-z]/)s=s"["toupper(c)""tolower(c)"]";else s=s""c};print s}'<<<"$1"`
- exit `[ -e $pattern ]`
- #!/bin/bash
- ##this is go.sh
- bash pattern.sh *.[Tt][Tt][Ff] && echo "字体文件存在" || echo "字体文件不存在"
复制代码 喜大普奔!
字体后缀有3种:
包含TureType字体的OpenType文件后缀名为.TTF
包含PostScript字体的文件后缀名为.OTF
包含一系列TrueType字体的字体包文件,那么后缀名为.TTC
要把这三个后缀都加入,那怎么处理?
是不是这样:
*.[Tt][Tt][Ff] *.[Oo][Tt][Ff] *.[Tt][Tt][Cc]
|
|