Let me throw in a solution as well. Since I also prefer a simple echo over loops with lots of forks:
`echo ----------------------------------------------------------------------------------------------- | head -c $total`
I.e. print a very large number of dashes and limit dynamically using head.