The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Pipes not working Furqan_79 Shell Programming and Scripting 1 05-29-2008 06:52 AM
perl help with pipes and file handles (simple issue) the_learner Shell Programming and Scripting 1 05-06-2007 02:34 AM
tee into 2 named pipes zzol UNIX for Advanced & Expert Users 9 12-12-2006 05:10 PM
cd using pipes Sinbad Shell Programming and Scripting 2 09-09-2004 07:05 AM
PIPEs and Named PIPEs (FIFO) Buffer size Jus Filesystems, Disks and Memory 1 08-20-2004 07:14 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-02-2001
Registered User
 

Join Date: Jul 2001
Location: Raleigh, NC
Posts: 4
Question Perl, Pipes, and FTP

I am attempting to automate an ftp session in PERL by emulating the user and sending commands to ftp, but I am getting unexpected and unwanted results. Here is a portion code that illustrates the method I am attempting (this was just a shot in the dark):

system("(
echo open server
sleep 1
echo username
sleep 1
echo password
sleep 1
echo ls) | ftp");

The ftp server doesn't appear to be interpretting the commands, and it appears to hang up somewhere around the username/password entry. Any help would be appreciated.

Thanks.
Bryan Murdaugh
Reply With Quote
Forum Sponsor
  #2  
Old 07-02-2001
mib mib is offline
Registered User
 

Join Date: Jan 2001
Location: Calicut
Posts: 228
Use Net::FTP Module from http://search.cpan.org


$ftp = Net::FTP->new("some.host.name", Debug => 0);
$ftp->login("name",'pass');
$ftp->cwd("mydir");
$ftp->get("file");
$ftp->quit;


HTH
Reply With Quote
  #3  
Old 07-03-2001
Registered User
 

Join Date: Jul 2001
Location: Raleigh, NC
Posts: 4
That was my first impulse, just to get the ftp module and use it, but I was hoping to get around it because this script needs to run on a LOT of machines. However, if there's no down-and-dirty brute force method to do it, I'll have to bite the bullet and install the module on all of the machines.

Thanks for the help!

Bryan
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:30 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 Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0