I am writing a shell script in which I have a loop. As the loop goes through different values get assigned to the variable i . I want to echo all the values that get i gets assigned each time the loop runs, into a text file.
What I am doing is at the moment is:
echo " $i " > fail
but that only gets me the last value that was assigned to i .