I want to create a zsh
program that goes through a block of text (the actual text will be large, multi-line ascii) and does two things:
- Set a color based on a number in the text
- Remove the number from the text
For example, suppose
- Color 1 is red
- Color 2 is blue
- Color 3 is yellow
and the text block is:
mytext='1a 2b 3c'
'1x 2y 3z'
the output text will echo:
a b c
x y z
Except they will be colored appropriately. I.e., ‘a’ will be red, ‘b’ will be blue etc.
Also not sure if it matters, but this will be loaded through source
as part of my custom shell scripts to create a colorful ascii output.