Consider I have a command with some pattern, for example:
$ grep "some string" file-[0-99]
how can I write result into a file that will have its name based on the current value of a pattern, so that
$ grep "some string" file-0 > processed-0
$ grep "some string" file-1 > processed-1
...
Something like $ grep "some string" file-[0-100] > processed-[0-100]
though this one doesn't work.