Operating System - HP-UX
1829727 Members
1851 Online
109992 Solutions
New Discussion

Re: Can I display message when sudo to Oracle is performed?

 
Prashant Zanwar_4
Respected Contributor

Can I display message when sudo to Oracle is performed?

I want to display a message whoever does sudo to oracle.
Message shall be displayed in some pattern. Formatted font, bold, might be somewhere Italic.
Is it possible?
Thx
P
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor

Re: Can I display message when sudo to Oracle is performed?

Because the TERM setting could be anything, you really have to use the terminfo database to do this. Fortunately, the tput command makes this quite easy. There are 2 sequnces that are defined for most TERM values "smso" and "rmso" for start standout mode and remove standout mode. "Standout mode" generally means a highly visible display (reverse bold video, for example).

tput smso # standout mode
echo "This should be very visble text"
tput rmso # remove standout mode
echo "This should be back to normal"

There are also sequences to go into alternate character sets but remeber, you have no way of knowing what kind of terminal is in use so sticking to smso/rmso is generally the most universal approach.
If it ain't broke, I can fix that.