Working with xenserver, and I want to perform a command on each file that is in a directory, grepping some stuff out of the output of the command and appending it in a file.
If you want to do multiple commands, you could use:
for I in `ls *.sql` do grep "foo" $I >> foo.log grep "bar" $I >> bar.log done