Executing commands for each result