1

I have been trying to implement printing a line made up of dashes. The most efficient/simple looking answer I found is: top-answer-from-here

Where to print 100 equals you do:

printf '=%.0s' {1..100}

to print 100 underscores you do:

printf '_%.0s' {1..100}

But to print 100 dashes I get an error: invalid option

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

I have tried to escape the - but then I get 100 "-"':

\-\-\-\-\-\-...etc...

How can I solve this?

code_fodder
  • 15,263
  • 17
  • 90
  • 167

1 Answers1

3

Separate arguments using --:

printf -- '-%.0s' {1..100}
anubhava
  • 761,203
  • 64
  • 569
  • 643