在稳健建路中,
提出了一个解决办法,其中包括:
shopt -s extglob; dir="${dir//+(\/)//}"
有人能帮我解释一下吗?我明白它在做什么,但不理解语法是如何工作的。
发布于 2011-10-30 02:43:27
来自bash(1)手册页:
bash(1)
+(pattern-list) Matches one or more occurrences of the given patterns
因此,它就像+ regex操作符,应用于父类中的模式。
+
https://unix.stackexchange.com/questions/23583
相似问题