大家快来看看这句shell脚本是啥意思!!

sh/bash/dash/ksh/zsh等Shell脚本
回复
bacoo_zh
帖子: 19
注册时间: 2009-05-09 16:01

大家快来看看这句shell脚本是啥意思!!

#1

帖子 bacoo_zh » 2009-06-21 10:59

if [ -z "${CDPATH:-}" ] || [[ "$cur" == ?(.)?(.)/* ]]; then

疑问点:
1。为什么有[],还有[[ ]],有什么不同?
2。?(.)?(.)/* 这是什么意思?
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: 大家快来看看这句shell脚本是啥意思!!

#2

帖子 xiooli » 2009-06-21 11:39

bacoo_zh 写了:if [ -z "${CDPATH:-}" ] || [[ "$cur" == ?(.)?(.)/* ]]; then

疑问点:
1。为什么有[],还有[[ ]],有什么不同?
現在版本的bash中基本没有差别吧?
2。?(.)?(.)/* 这是什么意思?
看不出来是一对mm的mimi么? :em06
头像
123161769
帖子: 40
注册时间: 2009-07-02 13:19
来自: 广州
联系:

Re: 大家快来看看这句shell脚本是啥意思!!

#3

帖子 123161769 » 2009-07-02 14:22

....回去背正则去~懒人
http://train.gd-linux.com/htdocs/ 广东省linux中心GDLC
回复