How do I repeat the same character to the end of the line

I want the echo character "=" to the end of the line, regardless of the size of the terminal window for the shell script

I can just do this:

echo -e "\e[1;35;40m =======================================================================================\e[0m" 

But this is just a random string. I want the character to repeat until the end of the line. How can i do this?

+4
source share
1 answer
 for i in $(seq 1 $(stty size | cut -d' ' -f2)); do echo -n "=" done 
+3
source

All Articles