The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Check existence of a login xavier054 UNIX for Advanced & Expert Users 10 03-06-2008 07:19 AM
Csh to check for existence of file Raynon Shell Programming and Scripting 9 12-05-2007 05:20 PM
How to check the file existence using shell scripting in Solaris-10 krevathi1912 SUN Solaris 2 11-26-2007 01:07 AM
Variable check for existence ? samit_9999 UNIX for Dummies Questions & Answers 2 12-05-2006 01:15 PM
check for FILES existence mpang_ Shell Programming and Scripting 3 06-28-2006 03:51 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2008
Registered User
 

Join Date: Jun 2008
Location: bangalore
Posts: 4
how to check the existence of a file using korn shell?

we have tranferred an ear from local server to remote server using ftp.consider, we have an ear file named a.ear in remote server,again if we transfer the same file named a.ear from local server to remote server.we need the kshell to check the existence of the ear file in remote server,and if the same file exists without any change ,it must echo an message and should not overwrite the ear.help ASAP....
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-18-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,099
To test the existence of a file there is "test -e <file>", but this is not what you want. You wnat not only to test the existence but also if two files (the remote and the local copy) are identical.

Maybe you could use "rsync", which does exactly that - transfer only a file which has changed.

I hope this helps.

bakunin
Reply With Quote
  #3 (permalink)  
Old 06-18-2008
Registered User
 

Join Date: Jun 2008
Location: bangalore
Posts: 4
Quote:
Originally Posted by bakunin View Post
To test the existence of a file there is "test -e <file>", but this is not what you want. You wnat not only to test the existence but also if two files (the remote and the local copy) are identical.

Maybe you could use "rsync", which does exactly that - transfer only a file which has changed.

I hope this helps.

bakunin
thank u backunin...actually i am a newbie, so can u explain with script which uses the"rsync".
Reply With Quote
  #4 (permalink)  
Old 06-19-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,099
Quote:
Originally Posted by karthikprasathk View Post
thank u backunin...actually i am a newbie, so can u explain with script which uses the"rsync".
Google is your friend: enter "rsync" into google and the very first link to come up is: rsync , complete with downloads, documentation, examples, an FAQ, and, and, and ....

bakunin
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:31 AM.


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 Global Fact Book

Content Relevant URLs by vBSEO 3.2.0