For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > November 2005 > Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem
RG

2005-11-28, 9:58 pm

Hi,

I have to write a C program which opens a xterm and automatically
executes another C file from this new terminal. I opened the xterm from
within the C program using

system("xterm");

However, I don't know how to automatically execute another C program in
this terminal. Can somebody suggest something?

Victor Wagner

2005-11-28, 9:58 pm

RG <rashii_g@rediffmail.com> wrote:
: Hi,

: I have to write a C program which opens a xterm and automatically
: executes another C file from this new terminal. I opened the xterm from
: within the C program using

: system("xterm");

: However, I don't know how to automatically execute another C program in
: this terminal. Can somebody suggest something?

system("xterm -e your_otherprogram");

Really there are some other useful command-line options of exterm. You
might like set window title for xterm or specify its size.

1. Read man xterm - there is a lot of useful information there
2. Try to do it by hand, starting new xterm from command line, typing
commands in the shell manually.
3. When command satisfies you, cut'n'paste it into your code from your
shell history


--
Robert Harris

2005-11-28, 9:58 pm

RG wrote:
> Hi,
>
> I have to write a C program which opens a xterm and automatically
> executes another C file from this new terminal. I opened the xterm from
> within the C program using
>
> system("xterm");
>
> However, I don't know how to automatically execute another C program in
> this terminal. Can somebody suggest something?
>

If you call

system("xterm top");

then you will automatically execute "top" in your xterm. Is that an
example of what you want?

"man xterm" will tell you about it.

Robert
RG

2005-11-30, 3:59 am

Hi,
Thanks a lot.
RG

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com