Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Closed Thread
  Search this Thread
Old 05-02-2007, 10:23 AM   #1
LQ Newbie
Registered: Jan 2006
Posts: 28

Rep: Reputation: 15
FTP in a Bash Shell Script redirection

I wrote a bash shell script which will upload files in a directory one by one.

Since I have to log the upload result of EACH file, I would like to redirect the responses from FTP server to a file (like vsftpd's xferlog). In the shell script, I have my own redirection like this

echo "Some times Someone did something..." >> daily.log

Is it possible to redirect the FTP Server response to that file too??

Many thanks. If any information needed, please let me know!!!

Connected to
220 "Welcome to MSL Fax Image FTP service."
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Switching to Binary mode.
200 Switching to Binary mode.
local: pantos-edibkg-manual.odt remote: pantos-edibkg-manual.odt
229 Entering Extended Passive Mode (|||48837|)
553 Could not create file.
local: pantos-sr-manual.odt remote: pantos-sr-manual.odt
229 Entering Extended Passive Mode (|||22316|)
553 Could not create file.
221 Goodbye.
Above is the sample FTP responses I would like to redirect to a file.

Last edited by sleepyhomme; 05-02-2007 at 10:24 AM.
Old 05-02-2007, 12:51 PM   #2
HCL Maintainer
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
Double post
Old 05-02-2007, 12:53 PM   #3
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 121Reputation: 121
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Output and Error redirection in Shell script (MinGW) montylee Programming 6 09-08-2006 06:06 AM
Bash shell script moodupani Linux - General 2 09-01-2005 07:14 AM
shell script output redirection goral.j Programming 3 01-27-2005 06:34 AM
I/O redirection in a shell script gladeiator Programming 1 11-27-2003 02:35 PM
bash shell script MaryM Linux - Newbie 0 02-16-2002 12:45 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration