change write command

I'm trying to write a very simple MUD(multiple user dungeon) using c++ on a UNIX box.  I do not know network programming, and don't have time to learn it in the scope of the project.  What I would like to do is to simply use the write command to communicate with other users on the system.  I only want them to see what I send though, and not the extra message, eod junk that the write command currently uses.  Also, I want to use a variables in the message.  Does anyone know how to accomplish this, or if not where I can get the source code for the write command?

Any suggestions on other ways to accomplish this would be helpful too.  Thanks a lot.
scottd1978Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
echo $message > /dev/ttynn
0
scottd1978Author Commented:
that solves half the problem already.  Now all we have to do is figure out how to send a variable to the system

not a unix variable, but a variable from the c++ program ...
0
cartoon022100Commented:
Try to do a "fopen("/dev/tty#","w")
and do ordinary file writes into the
terminal
use your variable to fprintf
it will work
if u dont succeed i'll send u the code for it

the above will work provided there is write permission for the receiving terminal

-Inigo(Cartoon)
0
cartoon022100Commented:
main()
{
FILE *fp;
int a = 10;
char b[10] = "your string";
fp = fopen("/dev/pts/4","w");

/* the receiving termminal number,this can be obtained thru many ways..here i have hardcoded,also the permission should be given for write */


fprintf(fp,"%s",b);
fprintf(fp,"%d",a);
}

/* through this u can print values of variables onto a terminal */

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.