How to repeat a dash (hyphen) in shell

前端 未结 7 863
北海茫月
北海茫月 2020-12-31 10:10

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

7条回答
  •  佛祖请我去吃肉
    2020-12-31 10:30

    1. jot can do it, with no bashisms:

      jot -s '' -b - 100
      
    2. seq too, but not as well, it needs a tr:

      seq -s- 100 | tr -d '[0-9]'
      

提交回复
热议问题