I am searching for away to execute the current command for each result of the file globbing without building a for loop. I saw this somewhere but can't remember where exactly.
(The echo is just an example, it should also work with psql for example)
Example:
$ touch aaa bbb ccc ddd
$ echo "--- " [a-c]*
--- aaa bbb ccc
Desired output:
--- aaa
--- bbb
--- ccc
Kown way:
$ for i in [a-c]*; do echo "--- " $i ; done
--- aaa
--- bbb
--- ccc
Could be done using for. But maybe there is a way to do it shorter? Maybe like using double curly braces around the glob or whatever?
Thanks. :)