查询子字符串
,子字符串完整匹配:
startpos=$(echo $1|awk '{print index($1,"3675612")}')
$ echo "78548-3675612" 56 |awk '{print index($1,$2)}'
10
$ echo "78548-3675612" 33356 |awk '{print index($1,$2)}'
0
文件名正则表达式过滤
#ls + grep -c
ls -l /home/path /log-api-release.file.* | grep -c ".[[:digit:]]$"
#find [0-9]
find /home/path -type f -name "log-api-release.file.[0-9]"
find /home/path -type f -name "log-api-release.file.[0-9][0-9]"