bashwildcardwildcard-expansion

Prepending some text to each "wildcard" argument in bash


A simple Example: mybin *.txt will expand to mybin a.txt b.txt c.txt

But I'm looking for a simple solution to have an expansion to something like: mybin --conf a.txt --conf b.txt --conf c.txt.

Is there a built in to do this? What is the simplest way for this?


Solution

  • find is my friend:

    mybin $(find /wherever/ -name '*.txt' -printf '--conf %p ')