simple for loop
by hatfani from LinuxQuestions.org on (#504P3)
HEllo guys,
I'm trying to take my output into a txt file but something is wrong.
Code:H=$(head -n1 SAMPLE.txt) ## = 19990
for ((i = $H ; i <= 19999 ; i++))
do
echo $i > FILL2.txt
donefor some reason it gives me only 19999 in FILL2.txt
while the output of echo $i is:
19990
19991
19992
19993
19994
and so on until 19999
what is wrong? I don't understand.


I'm trying to take my output into a txt file but something is wrong.
Code:H=$(head -n1 SAMPLE.txt) ## = 19990
for ((i = $H ; i <= 19999 ; i++))
do
echo $i > FILL2.txt
donefor some reason it gives me only 19999 in FILL2.txt
while the output of echo $i is:
19990
19991
19992
19993
19994
and so on until 19999
what is wrong? I don't understand.