Welcome to forums, hope you enjoy posting questions, sharing knowledge here. Coming to your question, I am not sure about your complete requirement but seems like you want to print from 1st line to till last line of a Input_file? If this is the case then you was close, could you please try following.
while read l
do
x=$((x+1))
printf "%04d\n" $x
done < "Input_file"
Please put your file name in place of Input_file above.
I was thinking about to use that, the problem is that originaly I had a script witch allow me to include this number in a comand to download some file.
count=0
while read p; do
echo wget -O "$2_img${count}.jpg" $p
count=$((count+1))
done <2
then, with your script I manadge to print all the line of the file,
but then it's does't seem to work to create command
I put echo to debug it but I want to make it part of a comand with wget.
and get rid of the echo when you are done debugging.
PS If you tell us what operating system and shell you're using, we might also be able to suggest some shell specific shortcuts to do this. Depending on what shell and (and version of that shell) you're using, there might be shortcuts that would run slightly faster, but would be less portable.