LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 688|回复: 0

shell "[["中的模式匹配问题

[复制链接]
发表于 2010-7-19 14:51:11 | 显示全部楼层 |阅读模式
再看shell 中[ 和[[ 的区别,看到如下的例子,有点不明白

13:50:10@myhost:~ $ [[ "abc def .d,x--" == a[abc]*\ ?d* ]]; echo $?
0
13:50:51@myhost:~ $ [[ "abc def c" == a[abc]*\ ?d* ]]; echo $?
1
13:55:35@myhost:~ $ [[ "abc def d,x" == a[abc]*\ ?d* ]]; echo $?
1
13:56:30@myhost:~ $ [[ "abc def .d,x" == a[abc]*\ ?d* ]]; echo $?
0


如题, [[ 是怎样对模式进行匹配的?
或者上述例子中模式到底匹配什么样的字符串?
谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表