473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Need Help regarding FTP

Hello,

I just started writing the script to connect to a virtual machine using ftp command in perl.
(I am having the Windows OS and the virtual machine has Linux)

The code is:

Line1: system("ftp 10.58.3.48");
Line2: system("ls -l");

But the problem is when I run this script from the command prompt, it executes Line1 and connects to the specified maching and then prompts for username and password which I enter manually. After entering username & password it doesnt continue executing Line2. It stops there.

I want this script only to enter the username and password. So what should I write in between Line1 & Line2 that will take the username and password and also execute the Line2(ie. the ls -l command) ?

Please help me for this.

Thanks.
Apr 23 '08 #1
1 1075
nithinpes
410 Expert 256MB
Hello,

I just started writing the script to connect to a virtual machine using ftp command in perl.
(I am having the Windows OS and the virtual machine has Linux)

The code is:

Line1: system("ftp 10.58.3.48");
Line2: system("ls -l");

But the problem is when I run this script from the command prompt, it executes Line1 and connects to the specified maching and then prompts for username and password which I enter manually. After entering username & password it doesnt continue executing Line2. It stops there.

I want this script only to enter the username and password. So what should I write in between Line1 & Line2 that will take the username and password and also execute the Line2(ie. the ls -l command) ?

Please help me for this.

Thanks.
You cannot achieve this using system() command. Make use of Net::FTP module.
You can see the usage and sample scripts for the module in CPAN if you follow the link.
Apr 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Anantha Narayanan Vijayaraghavan | last post by:
Hi Guys, I need a clarification regarding Global.asax file and webconfig file. When I was working in ASP I used to give my database connection in Global.asa. Now in .Net we have two file...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: sachin | last post by:
Hello Everybody I need some help regarding Natural Language Processing. I am designing a MT system from a SOV language to a SOV language. I need a parser which can find the root word...
34
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
1
by: Likhith Areekkal | last post by:
Hi, My background: Passed Bachelors in Computer Science 2 years back with distinction in Canada. Had to do survival jobs for 2 years as the comp. industry was in bad shape. Serious about...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
2
by: Geek | last post by:
Hi guys, I have a question regarding learning C++. I graduated with a Computer Science degree. recently I have found out that I need to learn languages better and professionaly. I am interested...
3
by: vijaykokate | last post by:
Our company http://www.softnmation.com/ offers its customers a great variety of products. Everything you need can be found in this site. Web Template, CSS Template, Logo Template, Corporate...
1
by: rija | last post by:
Hi folks, I need help regarding date and time comparison in PHP and MySQL My website is hosted in the USA (GMT - 8) And It is managed in Madagascar (GMT + 3) Want to consider DATE in Madagascar...
1
by: vikjohn | last post by:
I have a new perl script sent to me which is a revision of the one I am currently running. The permissions are the same on each, the paths are correct but I am getting the infamous : The specified...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.