If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > find a file on a remote machine

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-31-04, 19:46
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
find a file on a remote machine

I have 2 unix servers dev1 and dev2.
I have a shell script that runs in dev1 that is supposed
to look in the dev2 server for a specific file (clearance.dat) which
is located at /home/biotox folder(on dev2)

How can I mention this in the script tht runs on dev1?

Thanks
Reply With Quote
  #2 (permalink)  
Old 04-01-04, 03:34
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
A possible solution is to use rsh
Code:
if [ `rsh dev2 -l user_dev2 'test -e /home/biotox/clearance.dat ; echo $?'` -eq 0 ]
   then echo 'File found'
   else echo 'File not found'
fi
__________________
Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 04-01-04, 12:44
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
You are a treasure. Thanks
Reply With Quote
  #4 (permalink)  
Old 04-01-04, 17:05
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
I tried what you mentioned,
But when I run the script, I get

remshd: Login incorrect.
spk4rsh: 0041-003 No tickets file found. You need to run "k4init".
nologin: test: 0403-004 Specify a parameter with this command.
File Not found


What could be wrong ? Atleast it spit out "File Not found". But the file is actually there and should be found.

Thanks
Reply With Quote
  #5 (permalink)  
Old 04-02-04, 00:57
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
The problem comes from the rsh command.
There is a problem of identification on the remote (dev2) server.
Quote:
remshd: Login incorrect.
spk4rsh: 0041-003 No tickets file found. You need to run "k4init".

nologin: test: 0403-004 Specify a parameter with this command.
File Not found
Contact your system manager.
__________________
Jean-Pierre.
Reply With Quote
  #6 (permalink)  
Old 04-02-04, 12:31
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
Thank you. Let me call him
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On