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)
$ touch aaa bbb ccc ddd $ echo "--- " [a-c]* --- aaa bbb ccc
--- aaa --- bbb --- ccc
$ 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?
You may be looking for
zargs, a command with the same purpose as
xargs but a saner interface.
autoload -U zargs zargs -n 1 -- * -- mycommand