Linux command to repeat a string n times – Super User

I was working on something and needed to output the string n times. I have required this even to print a line with \’-\’ or \’=\’ but this time I badly wanted it in bash. So I searched google and found this:

printf \”Amit Agarwal%.0s\” {1..5}

Explanations and other examples: http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times

\"Enhanced

Linux command to repeat a string n times

Linux command to repeat a string n times

There are more than one situation where you wished that there was a simple way to print a character n number of times. At least I face that quite often, especially when you want to print a menu. I found this post today which has pretty good solution and also the way how it works :
http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times

\"Enhanced