I have this path in my react gulpfile:
var path = { HTML: 'src/index.html', ALL: ['src/js/*.js', 'src/js/**/*.js', 'src/index.html'], JS: ['src/js/*.js', 'src/js/**/*.js'], MINIFIED_OUT: 'build.min.js', DEST_SRC: 'dist/src', DEST_BUILD: 'dist/build', DEST: 'dist' };
What is the double glob character?
I know what the single glob is... but what is the double? single glob
The Bash shell feature that is used for matching or expanding specific types of patterns is called globbing. Globbing is mainly used to match filenames or searching for content in a file. Globbing uses wildcard characters to create the pattern.
In computer programming, glob (/ɡlɑːb/) patterns specify sets of filenames with wildcard characters. For example, the Unix Bash shell command mv *. txt textfiles/ moves ( mv ) all files with names ending in .
GLOB patterns or wildcard patterns. Characters that the shell will try to expand to match existing pathnames in the file system. These characters are sometimes called “wildcard” characters in other systems. A character that has a special meaning to the shell.
glob (short for global) is used to return all file paths that match a specific pattern. We can use glob to search for a specific file pattern, or perhaps more usefully, search for files where the filename matches a certain pattern by using wildcard characters.
It's almost the same as the single asterisk but may consist of multiple directory levels.
In other words, while /x/*/y
will match entries like:
/x/a/y /x/b/y
and so on (with only one directory level in the wildcard section), the double asterisk /x/**/y
will also match things like:
/x/any/number/of/levels/y
with the concept of "any number of levels" also including zero (in other words, /x/**/y
will match /x/y
as one of its choices).
As an aside, as much as I hate to credit the mainframe with anything, I believe this has been used since the earlist days of MVS to allow selection of datasets at multiple levels :-)
**
matches any character including a forward-slash /
*
matches any character except a forward-slash (to match just the file or directory name)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With