不区分大小写的匹配

制备

$ mkdir globbing
$ cd globbing
$ mkdir -p folder/{sub,another}folder/content/deepfolder/
touch macy stacy tracy "file with space" folder/{sub,another}folder/content/deepfolder/file .hiddenfile
$ shopt -u nullglob
$ shopt -u failglob
$ shopt -u dotglob
$ shopt -u nocaseglob
$ shopt -u extglob
$ shopt -u globstar

设置选项 nocaseglob 将以不区分大小写的方式匹配 glob

$ echo M*
M*
$ shopt -s nocaseglob 
$ echo M*
macy