Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to capture ftp output?

Status
Not open for further replies.

bondtrails

Technical User
Nov 19, 2002
31
US
Hi everyone,
Within a script, how can I capture the output of an ftp "ls" command??

I want to capture the directory output of an ftp site, then create a simple list of all files ending in ".dat"

---------
ftp -n $HOST
quote USER $USER
quote PASS $PASS
cd $DIRECTORY
ls "*.dat" # here's where i get the ls output
----------


What do I do to capture the output from "ls" ??

Thanks for helping out this newbie!!

--Bondster!!
 
put your ftp cmds in a ftpcmd-file
then exec

ftp -nv hostname <ftpcmds >output.dat -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top