LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-16-2012, 12:51 AM   #1
saidopdf
LQ Newbie
 
Registered: Jul 2012
Posts: 5

Rep: Reputation: Disabled
running another application(exe) on another terminal through c program


Hi everyone,

I want to run a c program ,that executes another application on another terminal.
ex.on executing a.out in one terminal(pts/1),calls executes another application in another terminal(pts/2).

thanks and regards
sai
 
Old 07-16-2012, 01:00 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,944

Rep: Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324
every process has a parent process and it cannot be changed (just parent can be terminated). So the terminal emulator window where you want to start your app will be the parent (or parent of parent of ...) of your app. From the other hand you can (re)open stdin, stdout to use any (other) terminal - if you have sufficient access permissions.
 
Old 07-16-2012, 01:07 AM   #3
saidopdf
LQ Newbie
 
Registered: Jul 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
what i am able to do is ,i am able to send data to the another terminal(using open call of file descriptor) , but my question is is it possible execute some .exe there it self.


Thanks and regards,
sai
 
Old 07-16-2012, 01:14 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,944

Rep: Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324
no, you cannot modify the parent-child chain, so the process started in terminal pts/1 will be the child of that terminal process and any app started in pts/2 will be the child of that terminal. With other words: any app has exactly one parent which started it and it cannot be changed. You can ask a process to start a child (if it was capable to do that), but you cannot start a process and "attach" it to another parent.
 
Old 07-16-2012, 01:18 AM   #5
saidopdf
LQ Newbie
 
Registered: Jul 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
no, you cannot modify the parent-child chain, so the process started in terminal pts/1 will be the child of that terminal process and any app started in pts/2 will be the child of that terminal. With other words: any app has exactly one parent which started it and it cannot be changed. You can ask a process to start a child (if it was capable to do that), but you cannot start a process and "attach" it to another parent.
so what you are saying is i can display the data on another terminal ,but cannot execute .exe in that terminal.
 
Old 07-16-2012, 01:20 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,871
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
check the source of 'openvt' and 'chvt' they might help
 
Old 07-16-2012, 02:04 AM   #7
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
What do you mean "another terminal"?

A terminal is just a pseudo output device, X terminal, console, a tty, a screen.
The question doesn't make sense as stated.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
running program from terminal gives me errors huntaz556 Linux - Newbie 4 10-26-2011 09:17 PM
is there a way to tell if a C program is running without a terminal? MrUmunhum Linux - General 4 05-11-2010 01:21 PM
Running program from terminal with & does nothing, program stops DittoAlex Linux - General 1 10-05-2007 01:35 AM
Running a Program in a new Virtual Terminal Johnsernickle Linux - Software 2 07-09-2004 11:50 AM
Running program when terminal closed? mikeshn Linux - General 9 11-23-2002 08:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration