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.
Using:
echo $(tput setaf <colour>)<text>$(tput sgr0) >> /etc/sudoers.lecture
adds coloured text to /etc/sudoers.lecture
lecture
? – k.stm Aug 23 '19 at 17:05sudoers(5)
manual. It is the short text that is outputted upon first usingsudo
, which (by default) reminds the user to use the command responsibly. – Kusalananda♦ Aug 23 '19 at 17:22tput
output, I created a file that sudo dutifully outputted in color. How did you produce the /etc/sudoers.lecture file? – Jeff Schaller♦ Aug 23 '19 at 18:38tput
works. – gadzooks02 Aug 25 '19 at 18:28