Runs the given command in a shell after all chunks have been processed.