rlogin inside a c-shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting rlogin inside a c-shell script
# 1  
Old 04-02-2005
rlogin inside a c-shell script

Hi Forumers,

Sorry if it's really simple, but I couldn't find a way out. Smilie

I've to do something like this in a script (csh):

<some commands, variable settings, scripts>
rlogin different_server
<some commands, variable settings, scripts>

After "rlogin", it shows the prompt of the machine on which I've logged on, and further script works only after I exit. Smilie

Basically, I've to fire a job on this new server.

How to do that?

Thanks,

Sumit Garg
# 2  
Old 04-02-2005
i don't use rlogin to fire off remote jobs ... rlogin is for passwordless logins ...

in solaris ...
Code:
rsh remotehost  "/path/to/job1;/path/to/job2 ..."

in hp (verify whether it's rsh or remsh)
Code:
remsh remotehost  "/path/to/job1;/path/to/job2 ..."

# 3  
Old 04-02-2005
attention moderators!!!

This'll work but my requirement is a bit complex.

As mentioned in my first mail, my script is like:

<some commands, variable settings, scripts>
rlogin different_server
<some commands, variable settings, scripts>

So I've to use certain variables declared previously on the new machine.

Ex. code

<lot of other code>
set cur_dir = `pwd`
rlogin new_server
cd $cur_dir

<lot of other code>

So i want something like this to be executed. That is only machine should get changed and i can use all the variables on new machine.

Is it possible???
# 4  
Old 04-02-2005
note that i use double quotes in the rsh line ...
Code:
set cur_dir = `pwd`
rsh remotehost "cd $cur_dir; job1; job2 ..."

# 5  
Old 05-23-2005
Hi,
I am having the same problem as Sumitgarg above. I want to do an rlogin and still be able to use the value of variables from the previous shell. is that possible at all.?

Thanks for your help in advance
# 6  
Old 02-01-2008
I also have a similar problem. I am rather new to Unix scripting also.

I am trying writing a script that will ftp a file from one server to another:

<random code>
>rlogin host2
>cd /newdir
>ftp host1
>cd /newdir
>get <Filename>

I tried using 'rsh' but couldnt get it to 'cd /newdir' or ftp.

Thank you for any help you can provide.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

2. Shell Programming and Scripting

Using HTML inside shell script

Hi, Am trying to use HTML tags inside my script but its not printing the required output. Any idea how to use html inside script will be helpful. #!/bin/ksh echo '<html>' echo '<font face='Calibri' size='3'> JobName Status</font>' echo '</html>' Output<html> <font ... (6 Replies)
Discussion started by: rogerben
6 Replies

3. Shell Programming and Scripting

How to merge Expect script inside shell script?

Hi I have two scripts one is Expect and other is shell. I want to merge Expect code in to Shell script so that i can run it using only one script. Can somebody help me out ? Order to execute: Run Expect_install.sh first and then when installation completes run runTests.sh shell script. ... (1 Reply)
Discussion started by: ashish_neekhra
1 Replies

4. Shell Programming and Scripting

Nohup inside shell script

Hi, I want to run another script inside shelll script in nohup mode. let explain. under the same folder ,I have two scripts scrone.sh scrtwo.sh In scrone.sh if then nohup ./scrtwo.sh & echo " Script two has been run correctly" else echo " Exiting from the script" fi If... (3 Replies)
Discussion started by: ckchelladurai
3 Replies

5. Shell Programming and Scripting

expect script inside shell script not working.

Shell Scipt: temp.sh su - <$username> expect pass.exp Expect script: pass.exp #!/usr/bin/expect -f # Login ####################### expect "Password: " send "<$password>\r" it comes up with Password: but doesnt take password passed throguh file. (2 Replies)
Discussion started by: bhavesh.sapra
2 Replies

6. Shell Programming and Scripting

how to run shell script inside expect script?

I have the code like this : shell script continues ... .... expect -c" spawn telnet $ip expect "login:" send \"$usrname\r\" expect "Password:" send \"$passwd\r\" expect "*\>" send \"$cmdstr\r\" ... (1 Reply)
Discussion started by: robbiezr
1 Replies

7. Shell Programming and Scripting

Call a perl script inside a shell script

Hi all, I have the following snippet of code.. #!/bin/sh echo "run perl script............" #Run the verification script perl bill_ver echo " perl script completed....." echo "rename files......" #Remove from all file in the directories test, test1, test2, test3 for f in... (3 Replies)
Discussion started by: chriss_58
3 Replies

8. Shell Programming and Scripting

invoking a shell script inside cgi shell script

Hi, I have an HTML form through which I get some text as input. i need to run a shell script say script.sh inside a perl-cgi script named main_cgi.sh on the form input. I want to write the contents of the form in a file and then perform some command line operations like grep, cat on the text... (2 Replies)
Discussion started by: smriti_shridhar
2 Replies

9. Shell Programming and Scripting

rlogin from Shell script

I am logged into an AIX Unix box. From there I want to remotely login to remotely login to an HP-UX Unix box and want to execute a command that will create a file. I want to get the file to the AIX box. Can someon eplease advise how to automate that in a shell script? At the first step I want to... (2 Replies)
Discussion started by: asutoshch
2 Replies

10. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies
Login or Register to Ask a Question