Operating System - HP-UX
1825601 Members
2769 Online
109682 Solutions
New Discussion

remsh command as root does not work.

 
SOLVED
Go to solution
someone_4
Honored Contributor

remsh command as root does not work.

I cant get my
remsh box1 -l root "cd to/the/dir;./this.scr"
to work. It will not execute the command ./this.scr right. I get an error.
saying ./start.nrcmd: nrcmd: not found.
Does anyone have any ideas? on what the problem might me?
5 REPLIES 5
Rita C Workman
Honored Contributor

Re: remsh command as root does not work.

Well, first do you have .rhosts file set up on the other box?
Now when I want to run a job remotely I set my remsh up like this:

remsh ./full path/script to run


Just one thought,
rcw
Dan Hetzel
Honored Contributor

Re: remsh command as root does not work.

Hi Richard,

You could use the full pathname for your command, like in:
remsh box1 -l root -n "/the/dir/this.scr"
or
remsh box1 -l root -n "sh -c \"cd /the/dir; ./this.scr\" "

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
someone_4
Honored Contributor

Re: remsh command as root does not work.

I got it to work .. I can exe. the command.
The .scr is acully a menu script. But the thing is that some of the commands on the menu do not work when I remsh the .scr.
But when I exe the .scr from the box everything in the menu works.
Darrel Louis
Honored Contributor

Re: remsh command as root does not work.

Richard,

As Dan mentioned, you should use the full pathname.
A script doesn't have the PATH's defined as in /etc/PATH.

Good Luck
Deshpande Prashant
Honored Contributor
Solution

Re: remsh command as root does not work.

Hi
When using remsh command on scripts, give full paths for all commands.
eg.
/usr/bin/echo "Sample comments"

Normally in my scripts I define commonly required paths as ENV variables at begining and then use it before each commands. This is required because when doing remsh it would not execute the .profile to set your env.

Thanks.
Prashant
Take it as it comes.