Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISSUE A WARNING MESSAGE

Status
Not open for further replies.

bennotech

Technical User
Aug 7, 2002
64
GB
Hello All,
I would like a "warning message" issued on screen every time a certain command (rsh) is issued.
ie
rsh nodename date
"THIS IS A WARNING, BLAH, BLAH !"

I don't want to stop the command from being run.
Any ideas,
cheers
Benno

...it really does get worse than this !!
 
Install an alias (put it in /etc/profile for eveyone's use):

Code:
$ alias rsh='echo BlahBlah;rsh'
$ rsh rhost date
BlahBlah
host: name rhost NOT FOUND


HTH,

p5wizard
 
Hello there,

you could write a script constantly running some kind of

tail -f | grep "command"

on the .sh_hist* files. And every time the grep finds the certain command you're looking for the command

wall "Warning Message"

is issued and put it into /etc/inittab...

But I'm not sure whether rsh commands generate an .sh_hist* entry or not. You'd have to issue rsh and have a look using

ls -ltr

and see if there's a fresh entry in one of the .sh_hist* files ...

Regards
Thomas
 
Better yet:

Code:
$ alias rsh='echo BlahBlah >&2;rsh'
$ rsh rhost date
BlahBlah
host: name rhost NOT FOUND


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top