kitsnail/blog

How can I repeat a character in Bash?

Opened this issue · 0 comments

out result example:

==================================================
  • method 1
seq -s= 50 | tr -d '[:digit:]'; echo
  • method 2
seq  -f "#" -s '' 50;echo
  • method 3
printf %50s |tr " " "="
  • method 4
printf '=%.0s' {1..50}

References: https://stackoverflow.com/questions/5349718/how-can-i-repeat-a-character-in-bash