3 ms·
If you use tput a lot it's also worth caching the output, because invoking it for every single color change and reset can really add up. If you know you're goin
by lilyball 2y ago
If you use tput a lot it's also worth caching the output, because invoking it for every single color change and reset can really add up. If you know you're going to use a bunch of colors up front you can just stuff them into vars
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
RESET=$(tput sgr0)