Hey guys, I'm relatively new to Unix Scripting hence the straight forward question.
I'm trying to write a loop that will output a number each time you want it too. All I seem to able to do is create a loop that will output an infinite stream of numbers that doesn't stop. For example I have a function insertlinefunction(), and when I call that function I want it to output a number '1:' , then the next time I call it, it will output '2:' etc.. So what i'm saying is that I want to be able to display a single number starting from one and increase by one each time I call the function. At the moment when I call the function it will output all of the numbers at the same time:
1:
2:
3:
4:
etc..
Hope that makes sense.
Thanks
I'm trying to write a loop that will output a number each time you want it too. All I seem to able to do is create a loop that will output an infinite stream of numbers that doesn't stop. For example I have a function insertlinefunction(), and when I call that function I want it to output a number '1:' , then the next time I call it, it will output '2:' etc.. So what i'm saying is that I want to be able to display a single number starting from one and increase by one each time I call the function. At the moment when I call the function it will output all of the numbers at the same time:
1:
2:
3:
4:
etc..
Hope that makes sense.
Thanks