Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: