Questions tagged [globstar]

Use this tag when a question is about the behavior of bash's (or any other shell that supports it) recursive globstar (`**`) operator. For general globbing questions, use the [glob] tag instead.

6 questions
25
votes
3 answers

bash globstar matching

I have this directory structure: ~/tmp/globstar ɀ find dir -type f dir/file.ext dir/subdir1/file.ext dir/subdir2/file.ext and, with the globstar option enabled in Bash, I can say: ~/tmp/globstar ɀ ls -1…
Vlad GURDIGA
  • 353
  • 1
  • 3
  • 8
5
votes
1 answer

Can ** (bash's globstar) run out of memory?

Can using bash's globstar (**) operator cause an out of memory error? Consider something like: for f in /**/*; do printf '%s\n' "$f"; done When ** is being used to generate an enormous list of files, assuming the list is too large to fit in memory,…
terdon
  • 234,489
  • 66
  • 447
  • 667
3
votes
1 answer

Why is the bash double star (globstar) operator often disabled by default?

It seems to be a very useful feature. But I had to learn that it is often disabled by default. I though about enabling it on my system. But there is probably a good reason why it is disabled. Without knowning that, it seems unwise to enable it.…
user194860
  • 133
  • 4
2
votes
1 answer

GLOBIGNORE='**/dont_doc/**' does not work!

I wanted to create a glob expression to ignore any file inside a dont_doc directory, but when I tried using using GLOBIGNORE to do it, it did not work: $ GLOBIGNORE='**/dont_doc/**' $ echo dont_doc/** dont_doc/customBlockHelpers.hbs.js…
1
vote
2 answers

how to check for existence of multiple patterns in bash

i have several patterns that include ** wildcard, let them be: foo/**/bar.xml foo/**/baz.xml and i have an example dirtree: $ tree foo/ foo/ └── deep ├── baz.xml └── even └── deeper └── baz.xml what would be easiest way…
murison
  • 163
  • 1
  • 6
0
votes
1 answer

How to use find with globs in a Bash shell script?

I'm trying to use find with globs in a Bash shell script. I've tried to both sourcing it and running it, but the command fails every time. #!/usr/bin/env bash # glob-test.sh - a script to test globs in find cd /to/a/windows/share-point find…
not2qubit
  • 1,578
  • 1
  • 20
  • 21