WSL with Ubuntu 18.04 and GNU bash, version 4.4.20(1)-release (x86_64-pc).
I wish to display a message with a conventionally named color via argument such as -red
, or -green
, or -blue
or anything like this (Without an end user required to define colors with machine syntax).
I don't think that even the modern versions of printf
or echo
can do that.
I'd prefer a shell-builtin and not installing anything.
printf
orecho
that takes your color name and turns it into the right ANSI escape code. I don't think there is a CLI tool that supports this (yet). – Panki Mar 12 '22 at 12:12