Solved

ftp in non-interactive mode

Posted on 2001-07-17
4
1,463 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
[X]
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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

691 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