使用<代码>globstar 选项 bash,在使用两个相邻星时,将重印各子公司的所有档案名称。
使用:
shopt -s globstar
for i in /home/school/exam/**
The reference here is man bash
:
globstar
If set, the pattern ** used in a pathname expansion context
will match all files and zero or more directories and
subdirectories. If the pattern is followed by a /, only
directories and subdirectories match.
www.un.org/Depts/DGACM/index_spanish.htm
* Matches any string, including the null string. When the
globstar shell option is enabled, and * is used in a
pathname expansion context, two adjacent *s used as a
single pattern will match all files and zero or more
directories and subdirectories. If followed by a /, two
adjacent *s will match only directories and subdirecto‐
ries.