Bash Globbing/通配

Bash语言不支持正则表达式,而是通配的使用方式。sed awk 等工具支持正则表达式。

Bash itself cannot recognize Regular Expressions. Inside scripts, it is commands and utilities – such as sed and awk – that interpret RE’s.

Bash does carry out filename expansion [1] – a process known as globbing – but this does not use the standard RE set. Instead, globbing recognizes and expands wild cards.

Question mark – (?)

一对一通配。

Asterisk – (*)

0或者多个

Caret – (^)

[]: outside: select
[]: inside: highlight

Exclamatory Sign – (!)

outside caret

Dollar Sign – ($)

end

Curly bracket – ({})

多个globbing

References

[1] bash_globbing_tutorial
[2] parallel_cheatsheet


版权声明:本文为Vitalia原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。