I am processing a file content using a foeach loop in unix environment and I would like to print the percentage of task completed in a single line on the xterm. something like an increasing counter.
foreach xxx (`cat file1`)
set total = `wc -l file1`
# count definination
# print percentage completed => count/total
end
Content of file1 is some test in a single column
aaa
bbb
ccc
ddd
Output expected is
> 25%
> 50%
updated numbers overwrite the previous status on the same line. something like a live ticker