3 ms·
Since when `{...}' syntax is a glob pattern? What does `{a,b}/c' produce when there is no directory named `a'?
by oguz-ismail2 8mo ago
Since when `{...}' syntax is a glob pattern? What does `{a,b}/c' produce when there is no directory named `a'?
- hidroto 8mo agowould it not just produce 'b/c'? assuming 'b/c' is an existent file path what else could you justify it doing?
- thayne 8mo agoThe behavior of bash would be to produce "a/c" and "b/c", even if both files don't exist
- oguz-ismail2 8mo agoWhat sibling comment says. Bash does suppress nonexistent products when the pattern includes a glob metacharacter and `shopt -s nullglob' is in effect, but I didn't see a flag or anything to achieve that in the project README.
- deleted 8mo ago[deleted]
- Spivak 8mo agoGlobbing is a matching library. It just means match a/c or b/c if they exist. You should get an iterator of somewhere between zero and two elements.
- neogoose 8mo agoSince glibc (better to say csh) implemented it. https://man7.org/linux/man-pages/man3/glob.3.html https://man7.org/linux/man-pages/man3/glob.3.html search for GLOB_BRACE