Is there a shell (bash,zsh,??) that supports something like this?
git branch -D <feature1,feature2,feature3>
that would effectively make a transformation to:
for BRANCH in feature1 feature2 feature3; do git branch -D $BRANCH; done
No, because this is not nearly as useful as it sounds. Most commands accept multiple arguments already, including git branch -D
:
$ git branch -D foo bar baz
Deleted branch foo (was 9e9d099).
Deleted branch bar (was 9e9d099).
Deleted branch baz (was 9e9d099).
Commands that don't accept this typically have a good reason not to. For example, convert "$file" output.jpg
has an explicit output path, and naively looping over filenames would just overwrite the output.
For these things, zsh
has short form for
loops if it helps:
for f (foo bar baz) convert "$f.png" "$f.jpg"