My script is reading an input file row by row from start to end in a WHILE loop.
Lets say there is 100 rows in the input file.
when I will run the script, say script.ksh
It should show, 1 % completed, when 1 row is read from the input file.
2 % completed, when 2 rows are read from the input file.
and show on…
I want to show the percent completion bar from 1 to 100, in a single line output, not in 100 lines.
100 % completed. when the script ran successfully.
$value % completed.
here, $value should change from 1 to 100 as per the progress in a single line.
Example:
in file ipfile.txt, I have
1
2
3
4
.
.
upto
100
count=1
while read line
do
.......
.......
count=`expr $count + 1`
done<ipfile.txt
Here $count value will change from 1 to100.
when I will run the script,
output:
1 % completed. when $count=1
2 % completed. when $count=2
and show on upto 100 %.This completion status should be in single line output.
Hope my requirement is clear, let me know if it’s need any more explanations.
Thanks
1 Answer