The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
automating file search and replace text ommatidia Shell Programming and Scripting 3 02-28-2008 04:40 PM
Retrieving PID from a file appleforme1415 UNIX for Dummies Questions & Answers 5 10-18-2007 02:44 AM
retrieving pid p_aishwarya UNIX for Advanced & Expert Users 3 09-16-2007 05:59 PM
Using loop reading a file,retrieving data from data base. Sonu4lov Shell Programming and Scripting 1 01-19-2007 03:38 AM
retrieving a deleted file jyotipg UNIX for Advanced & Expert Users 2 01-04-2002 08:49 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-26-2005
vicesjr vicesjr is offline
Registered User
  
 

Join Date: Apr 2005
Location: Philippines
Posts: 2
Automating Rlogin and File Retrieving

Hi,
I'm a begginer in Unix Scripting and i'm trying to write a script that performs this functions..
1. Rlogin to a system
2. Copy a Perl script inTO the system
3. Run the Perl Script
4. Retrieve the result(file) of the Perl Script
5. Copy the result file to a single system
6. Logout of the system

This process is repeated to 10 systems. This script is moreless a data extraction script.

Your help is greatly appreciated..
Thank you
  #2 (permalink)  
Old 04-26-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Here's a sample script that you can run on the central system where the output will be stored:

Code:
#!/bin/sh
rcp <path of perl script> <remote system>:<dest path of script>
rsh <remote system> -n -l <username on dest system> <remote path of script>
rcp <remote system>:<remote path of output of script> <local path of output>
You can put this in a for loop if running for more than one system.
  #3 (permalink)  
Old 04-27-2005
vicesjr vicesjr is offline
Registered User
  
 

Join Date: Apr 2005
Location: Philippines
Posts: 2
Thanks a lot!!
The file copying command works fine but when the script is executed an error occurs. It says "Could not open file". But when I rlogin to the remote system and execute the script manually there is no error and the script runs smoothly.

The script is supposed to open certain files w/in a directory in the remote system.

Please advise, thanks..

Last edited by vicesjr; 04-27-2005 at 04:48 AM..
  #4 (permalink)  
Old 04-27-2005
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
slight change ... the remote script transfer maybe getting the execute bit unset based on the umask value for the user at the remote server ...
Code:
#!/bin/sh
rcp -p  <path of perl script> <remote system>:<dest path of script>
rsh <remote system> -n -l <username on dest system> <remote path of script>
rcp -p  <remote system>:<remote path of output of script> <local path of output>
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0