Bash Globbing/通配

发布于:2022-11-28 ⋅ 阅读:(422) ⋅ 点赞:(0)

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


网站公告

今日签到

点亮在社区的每一天
去签到