The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
PC connection to an old UNIX machine tonyingesson UNIX for Dummies Questions & Answers 8 01-24-2006 10:56 AM
missing Path(in UNIX) when i launch a job on to unix machine using windows SSh megastar UNIX for Advanced & Expert Users 1 11-04-2005 04:36 AM
HTTPS connection unix rkumar28 UNIX for Advanced & Expert Users 2 06-24-2004 04:20 PM
unix to unix serial connection question typsam IP Networking 1 10-17-2002 01:39 PM
Unix/WindowsNT Connection elrod UNIX for Dummies Questions & Answers 2 11-20-2000 05:13 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-01-2006
Registered User
 

Join Date: Sep 2006
Posts: 17
Connection to another Unix machine

Requirements

I'm running a shell script from one Unix server A which calculates the line count using "wc -l" of a file which resides in another unix server B.

I have tried the ssh also but i'm not very clear about it and its throwing error. The command I'm trying to use is:

ssh user1@serverB /temp/tmpdir/wc -l abc.txt

Please let me know how can i achieve the same using the shell script.
Reply With Quote
Forum Sponsor
  #2  
Old 11-01-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 988
What error is it throwing?
Reply With Quote
  #3  
Old 11-02-2006
Registered User
 

Join Date: Sep 2006
Posts: 17
Error is:

ksh: /temp/tmpdir/wc: not found
Reply With Quote
  #4  
Old 11-05-2006
Tornado's Avatar
Registered User
 

Join Date: Nov 2006
Location: Melbourne
Posts: 243
try...
ssh user1@serverB cat /path/to/abc.txt | wc -l
Reply With Quote
  #5  
Old 11-05-2006
Registered User
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 233
ssh -l user host "wc -l /path/to/abc.txt" works too
Reply With Quote
  #6  
Old 11-06-2006
Registered User
 

Join Date: Sep 2006
Posts: 17
Thanks..

both the above command works ..

but what if i dont want the word count of that file and just want to make a check whether the file is present on the remote unix machine?

how to do that?
Reply With Quote
  #7  
Old 11-06-2006
Registered User
 

Join Date: Sep 2006
Posts: 17
In addition to the previos query ... i have tried FTP also.

on 2 machines the connection and the script works fine. But on one machine it gives the following error:

ftp: connect: Connection refused
ftp: connect: Connection refused


What should I do?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0