Last active
December 16, 2021 11:31
-
-
Save ahmtcn123/9b7fb4add9ea84a09102c41ad4fb9df6 to your computer and use it in GitHub Desktop.
Print given text chars with random colors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text="Yeyyyyyyyyyyy 6 colorsssss" | |
max=999 | |
#Iter over 0 and 999 | |
for ((e=0; e<${max}; e++)); | |
do | |
#Iterate all chars | |
for (( i=0; i<${#text}; i++ )); | |
do | |
#Get int between 31 and 37 | |
randomColorInt=$(shuf -i 31-37 -n 1) | |
#\e[(randomColor)m(karakter) | |
echo -n -e "\e[${randomColorInt}m${text:$i:1}" | |
done | |
#Add new line | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment