December 2018
Beginner
452 pages
12h 17m
English
Basic globbing is done mainly with the wildcard, sometimes combined with part of a filename. However, just as regular expressions allow us to substitute a single character, so do globs.
Regular expressions achieve this with the dot; in globbing patterns, the question mark is used:
reader@ubuntu:~/scripts/chapter_09$ ls -l if-then-*-rw-rw-r-- 1 reader reader 448 Sep 30 20:10 if-then-else-proper.sh-rw-rw-r-- 1 reader reader 422 Sep 30 19:56 if-then-else.sh-rw-rw-r-- 1 reader reader 535 Sep 30 19:44 if-then-exit-rc-improved.sh-rw-rw-r-- 1 reader reader 556 Sep 30 19:18 if-then-exit-rc.sh-rw-rw-r-- 1 reader reader 416 Sep 30 18:51 if-then-exit.shreader@ubuntu:~/scripts/chapter_09$ ls -l if-then-e???.sh-rw-rw-r-- 1 reader reader ...