[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


ftp in non-interactive mode

Posted on 2001-07-17
Medium Priority
Last Modified: 2012-08-13
I want to ftp a file in a non-interactive way from a Nt machine [ftp server is installed in NT machine]

ie. something like this.. in a single line

The foll. will be invoked in a unix system

$ ftp <ip addr> user <username> password <passwd> get filename

There is a tool "expect" using which we can put our commands in a file and "expect" will take care of the rest. Other than this, ie. without using expect , is there a way to do this, using shell commands alone?

Question by:dssuresh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

ducpham earned 200 total points
ID: 6289333
have you tried the option -s:filename?

Expert Comment

ID: 6296965
your standard PC ftp will read from a file:
ftp -s:filename
(check with ftp -h)
so if you want to do it as you indicate, then you can
make a batch file or script that you call myftp

in the script you will be grabing $1 $2 $3 etc..
build your tempfile so:
echo "USER fred" >tempfile
echo "password xyz" >>tempfile
echo get $3 >>tempfile
ftp -s tempfile
delete tempfile

the correct syntax you have to do yourself..
but this is the Idea.

your Unix ftp example doesn't work from a csh...
I also use a script to autoftp under Unix.
LVL 11

Expert Comment

ID: 6828361
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "ducpham, th94nn" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt


Expert Comment

ID: 6846003
Comment from ducphan accepted as answer.
th94nn. look for your question in this topic area.

Thank you
Community Support Moderator

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question