2

Having set a lecture with Default lecture=always and Default lecture_file=/etc/sudoers.lecture, I would like to add colour to it. ANSI escape characters show without escaping, and creating a wrapper function displays it every time I use sudo, even if the password is in the cache.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
gadzooks02
  • 141
  • 4

1 Answers1

2

Using:

echo $(tput setaf <colour>)<text>$(tput sgr0) >> /etc/sudoers.lecture

adds coloured text to /etc/sudoers.lecture

gadzooks02
  • 141
  • 4