mirror of
https://github.com/flokoe/bash-hackers-wiki.git
synced 2024-11-25 07:43:42 +01:00
24 lines
908 B
Plaintext
24 lines
908 B
Plaintext
|
====== Globbing ======
|
||
|
|
||
|
Globbing is the procedure of
|
||
|
* matching all filenames against a given pattern
|
||
|
* expanding to all matching filenames
|
||
|
|
||
|
Unlike MSDOS, where the called program had to interpret the patterns, the globbing on UNIX(r) is done by the shell, the matched filenames are given as parameters to a called command:
|
||
|
<code>
|
||
|
$ cat *.txt
|
||
|
</code>
|
||
|
really executes
|
||
|
<code>
|
||
|
$ cat 1.txt 3.txt foobar.txt XXX.txt
|
||
|
</code>
|
||
|
|
||
|
The term "glob" originates back in the UNIX(r) days where an executable ''glob'' (from "global") existed which was used to expand pattern-matching characters. Later, this functionality was built into the shell. There's still a library function called ''glob()'' (POSIX(r)), which serves the same purpose.
|
||
|
|
||
|
===== See also =====
|
||
|
* [[dict:terms:shell | shell]]
|
||
|
* [[dict:terms:hardlink | hardlink]]
|
||
|
|
||
|
===== See also (article) =====
|
||
|
* [[ syntax:expansion:globs | pathname expansion]]
|