Skip to content
Advertisement

Tag: repeat

How to repeat a dash (hyphen) in shell

How can I repeat the character – n times in shell? I have read and tried this, but this does not work for -. It throws error invalid option. Below is the exact command that I used: Original posted line: printf ‘-%0.s’ {1..100} I also tried escaping – by putting a but in that case it repeats – n

Advertisement