Login to a new machine and run the rest of csh script in that new machine

37 Views Asked by At

I have a linux csh code. I need to run part of the code in another virtual machine. How can I do that?

My code has following steps

  1. echo $PWD
  2. rsh
  3. mkdir NEW
  4. cd NEW
  5. echo $PWD
  6. Logout from new machine
  7. cd <previous location
  8. echo $PWD

Step 3-6 should be executed in new machine.

1

There are 1 best solutions below

2
tink On

You can't do it like that w/ rsh.

echo $PWD
rsh <host> 'mkdir NEW; cd NEW; echo $PWD'
cd <previous location
echo $PWD

I haven't used rsh in decades, and none of the machines I have access to have the client or the server installed, so I can't say whether this will work or not for sure.