Solved

ftp in non-interactive mode

Posted on 2001-07-17
4
1,448 Views
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?

0
Comment
Question by:dssuresh
4 Comments
 

Accepted Solution

by:
ducpham earned 50 total points
ID: 6289333
have you tried the option -s:filename?
0
 
LVL 1

Expert Comment

by:th94nn
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.
0
 
LVL 11

Expert Comment

by:griessh
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

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 1

Expert Comment

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

Thank you
Computer101
Community Support Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now