1834535 Members
3437 Online
110069 Solutions
New Discussion

remsh

 
SOLVED
Go to solution
Paul McCleary
Honored Contributor

remsh

Hi,

Hopefully quite a simple one! I'm trying to change the AUTO file on another server using remsh. I know all the authentication is ok, as I can rlogin and execute other simple commands (e.g. ll, pwd etc.) via remsh.

The syntax I'm using is:

remsh otherhost -n /usr/sbin/mkboot -a "hpux /stand/vmunix.prev" /dev/rdsk/c0t6d0

The disk device is correct and if I execute the command locally it works. I tend to get two errors:

1) Can't stat the device - is this because it is trying to execute some part of the command on the local server and I've not quoted correctly??

2) Illegal number of arguments specified error for mkboot.

This may seem a pointless exercise to some of you, but there are good (somewhat dull) reasons for needing to do this in this way.

Any solutions would be much appreciated.

Cheers, Paul
5 REPLIES 5
Robert-Jan Goossens
Honored Contributor

Re: remsh

Hi Paul,

How about this,

# remsh otherhost -n "/usr/sbin/mkboot -a hpux /stand/vmunix.prev /dev/rdsk/c0t6d0"

Robert-Jan
David Child_1
Honored Contributor
Solution

Re: remsh

Paul,

You might try changing your syntax to:

remsh otherhost -n "/usr/sbin/mkboot -a \"hpux /stand/vmunix.prev\" /dev/rdsk/c0t6d0"
Kenneth Platz
Esteemed Contributor

Re: remsh

Paul,

Your local shell is stripping off the quotes around your "hpux /stand/vmunix.prev". As David said earlier, you will need to escape those double quotes somehow. One possibility is this:

remsh otherhost -n "/usr/sbin/mkboot -a 'hpux /stand/vmunix.prev' /dev/rdsk/c0t6d0"

Hope this helps.
I think, therefore I am... I think!
Sridhar Bhaskarla
Honored Contributor

Re: remsh

Hi Paul,


I would put everything in quotes

remsh otherhost -n "/usr/sbin/mkboot -a \"hpux /stand/vmunix.prev\" /dev/rdsk/c0t6d0"

However, if I have to create boot disks on a remote server, then I would not do each and everystep using 'remsh'. I would write a script, copy it to the remote server and then execute it.

scp my_script otherhost:/tmp
ssh otherhost:/tmp/my_script

Ofcourse you would be using remsh and rcp if you don't have ssh installed.

Would you mind telling us what you are trying to do?. vmunix.prev sounds interesting.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Paul McCleary
Honored Contributor

Re: remsh

Hi All,

Thankyou all v.much for your replies.

Top marks to David who provided the answer first.

I had already tried your suggestion Robert, without success :-(, but cheers anyway.

I had also used the \ so that it would ignore the " marks, as I knew it would be something to do with that. However, I put them after the " marks, not before!

Anyway, must crack on with it now. Thanks again for your assistance.

Paul