LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-19-2004, 02:30 PM   #1
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Rep: Reputation: 34
FTP control through script


I'm trying to find a way to control an FTP session through a Perl script, and (I really never thought I'd ever say this) I've found to be alot less hassle in Windows than on *nix.

Essentially, on a Windows system, if I create a file as such (we'll call it ftpcommands.txt):
Code:
username
password
commands to be executed
bye
then call FTP from the script like so:
`ftp -s:ftpcommands.txt ftp.myserver.com`;

FTP connects to ftp.myserver.com, the -s switch tells it to execute the commands in the file, and it exits. But this only works under Windows. Basically, I'm wondering if there's a *nix equivalent to this.

Thanks in advance
This
 
Old 05-19-2004, 03:51 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
You will get more control if you use Net::FTP in your perl script
http://search.cpan.org/~gbarr/libnet-1.18/Net/FTP.pm
 
Old 05-20-2004, 12:31 PM   #3
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Original Poster
Rep: Reputation: 34
Thank you, that appears to work across platforms
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent Help: Perl FTP Script Using NET::FTP xboxter Programming 8 05-16-2005 06:57 PM
remote control & ftp problems lgtristan Solaris / OpenSolaris 5 05-13-2005 09:11 AM
Access control for telnet and ftp aroop Linux - Security 8 08-27-2004 04:24 PM
Anyone Got A Traffic Control Script?? 311Sam Linux - Networking 4 06-22-2004 05:17 PM
bandwidth control under proftpd ftp server adrianmak Linux - Networking 1 01-02-2003 03:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration