You can redirect the loop output to a file using the done command:
#!/bin/bash for (( v1 = 1; v1 <= 5; v1++ )) do echo "$v1" done > file
If there is no file, it will be created and filled with the loop output.
This redirection is helpful when you don't need to show the loop output on the screen and save it to a file instead.