Operating System - HP-UX
1844093 Members
2448 Online
110227 Solutions
New Discussion

remsh command from the "c" program

 
sheevm
Regular Advisor

remsh command from the "c" program

Hello All!!

remsh command does not work from the application.

remsh command is executed using "c" program.

But if I execute the same command on the command line it works fine.

The questions is how do we make remsh execute the command in the same envirionment as the command line.
be good and do good
3 REPLIES 3
Sundar_7
Honored Contributor

Re: remsh command from the "c" program

Check out "man on" - this can do for you. If the environment is really very imp, then why not create a script on the remote system which can simulate the local environment and execute the command.
Learn What to do ,How to do and more importantly When to do ?
A. Clay Stephenson
Acclaimed Contributor

Re: remsh command from the "c" program

It all depends upon how you are trying to do it. If you use the system() function, you can build up as complex as remsh command as you like including stdout and stderr redirection.

If you are trying to use popen() then you need to be aware of how stderr is handled.

One thing to be aware of is the the return value of both system() and pclose() tells you nothing about the exit code of the remsh'ed command. Likewise, you know nothing about exit status when remsh'ing from the shell.

You probably need to add the "-n" option to your remsh.
If it ain't broke, I can fix that.
Sathish C
Frequent Advisor

Re: remsh command from the "c" program

Hi
Please post us the exact line on the c code where its trying to remsh , then we can suggest you the solution .

Thanx
Some cause happiness wherever they go; others, whenever they go