Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to redirect ftp output to a file from shell script?

 
manoj r patil
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one cronjob bash script which is performing different ftp tasks. I want to ouput of the ftp commands to some file for some intermidiate processing. How can I do that from within the script?

Below is the sample extract of ftp I am using -

ftp 10.x.x.45 << INPUT_END

# different ftp commands...

INPUT_END
 
Rahul Chaudhari
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use fillowing line in your script. It writes the output of FTP in Specified file.

ftp 10.x.x.45 > FILENAME << INPUT_END

# different ftp commands...

INPUT_END
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic