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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO DISPLAY NEWS IN CDE in AIX

Status
Not open for further replies.

hari59

IS-IT--Management
Mar 14, 2002
9
0
0
IN
Sir,
How the news can be displayed in CDE environment. The news in /var/news will be displayed only in ascii.
Kindly advice.
 
Hi,

If you mean just poping out an X-window in CDE -can do the following :

===================
STRING=”YOUR NEWS GO HERE”
# Create temp script:
echo "#!/bin/sh \necho \`date +\"%T\"\` \\n \"$STRING\" > /msg_tmp
chmod 777 /msg_tmp

# Kill existing dialog
kill -9 `ps -ef | grep "sh -c /msg_tmp" |grep -v grep |awk '{print $2}'` > /dev/null 2>&1

# Execute in window
TERM_TYPE=`echo $TERM`
if ps –ef|grep xinit |grep –v grep > /dev/null ;then
aixterm -T "$TITLE" –fn typeB18 -bg $BG -fg $FG -cr $CR -geometry 80x$ROWS+40+40 -e /bin/sh -c /msg_tmp &
else #vt term
echo "echo \"\n\n\"" > msg_tmp.vt
grep -v read /msg_tmp >> msg_tmp.vt 2>/dev/null # lose the line that pauses for input
echo "echo \"\n\n\"" >> msg_tmp.vt
chmod 777 /msg_tmp.vt
/msg_tmp.vt
fi
==============================================

"Long live king Moshiach !"
 
Hi,
What I want is, I want to send, say a message, to the users in the network. I can copy the message in the directory /var/news and when the user logs in, it will always display in the terminal if I give a command "news -a" in the /etc/profile. But in CDE it is not poping up. In this case, to pop up in CDE, where I have to put the message.
Thank you.
 
That's what I meant.

You should put your srtring in the variable :

STRING=”YOUR NEWS GO HERE”

The above section is part of the kornshell script that does the x-windows pop-up in CDE environment.
Just run it and see that it works,that what I do here.
At the top of the script add line:

#!/bin/ksh

"Long live king Moshiach !"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top