globstar
オプションでは、隣接する2つの星を使用するときに、bashはサブディレクトリ内のすべてのファイル名を再帰的に返します
つかいます :
shopt -s globstar
for i in /home/school/exam/**
ここのリファレンスは 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.
と info bash
:
* 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.