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:


This site uses Akismet to reduce spam. Learn how your comment data is processed.