how to generate var len strings of a given char

I am looking for a clever way to generate a string of a given chararcter repeated N times in a shell,
for example 12 of '-' would produce '------------'

I saw a good example in CFAJ book, a function called repeat that would run a cycle and concatenate a char to the string N times. It would defenitely work, but I am just in hope of some kind of a clever one-liner type of trick. Anybody have an idea?

With shells that support brace expansion:

printf '-%.0s' {1..12}

With some awk implementations (GNU awk, nawk):

awk 'BEGIN{$12=OFS="-";print}'

With Perl:

perl -le'print"-"x12'

zsh:

print ${(l.44..\055..\055.)}

Ruby:

ruby -e 'puts"-"*12'

There is another thread here.

Nice!