Skip to Content
Learn Linux Shell Scripting - Fundamentals of Bash 4.4
book

Learn Linux Shell Scripting - Fundamentals of Bash 4.4

by Sebastiaan Tammer
December 2018
Beginner
452 pages
12h 17m
English
Packt Publishing
Content preview from Learn Linux Shell Scripting - Fundamentals of Bash 4.4

Advanced globbing

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Bash Scripting Fundamentals

Bash Scripting Fundamentals

Sander van Vugt

Publisher Resources

ISBN: 9781788995597Supplemental Content