![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help need to make a shell script run for ffmpeg vhook watermaking in shell | wingchun22 | Shell Programming and Scripting | 1 | 09-27-2008 07:52 AM |
| Linux Shell Question: how to print the shell script name ? | meili100 | UNIX for Dummies Questions & Answers | 3 | 07-01-2008 02:55 PM |
| How to Start a Shell as Login shell instead of ordinary shell | Sivaswami | Linux | 3 | 07-01-2008 02:52 PM |
| Difference between writing Unix Shell script and AIX Shell Scripts | haroonec | AIX | 0 | 04-12-2006 03:27 AM |
| how to convert from korn shell to normal shell with this code? | forevercalz | Shell Programming and Scripting | 21 | 11-23-2005 02:18 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
C Shell RPC help
Hello everyone,
I am writing a rpc program, I have put the server program on a directory in another computer and i run the client program from my computer. I want that when i call a function in the server program it will have to execute a shell script and the retruning of the shell script be caught by the server program and sent back to my client to watch or manipulate. |
|
||||
|
here is the layout of my files:
On the server PC: server_program shell_scrip On the client PC: client_program shell_script Code:
ls -l / Code:
shell = popen("./shell_script", "r")
//and then comes the reading
|
|
|||||
|
Then you've either got one weird terminal setup (unless I'm mistaken, in which case I'm asking for enlightenment), or your shell script (or a program within) explicitly writes to the terminal, or your program still has some debug printf()'s in it writing to a term.
I couldn't reproduce your problem even with fork()ing and closing all (unneeded) file descriptors (code in attachment) Code:
$ ./process $ cat output.txt bin boot dev etc home lib lost+found media mnt opt proc root sbin srv sys tmp usr var var insgesamt 0 lr-x------ 1 pludi users 64 30. Apr 13:12 0 -> pipe:[1498244] l-wx------ 1 pludi users 64 30. Apr 13:12 1 -> /tmp/testbed/output.txt l-wx------ 1 pludi users 64 30. Apr 13:12 1 -> /tmp/testbed/output.txt |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|