The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to get exit code in a pipe-lined command? pankai Shell Programming and Scripting 3 01-10-2008 03:36 PM
How can I use pipe command ? bintaleb UNIX for Dummies Questions & Answers 11 04-16-2007 12:16 PM
pipe command zomboo UNIX for Dummies Questions & Answers 1 10-31-2004 03:04 PM
ret val of a command in a pipe which is NOT the last one latze Shell Programming and Scripting 5 11-01-2002 07:32 AM
How to pipe command anonymous.nico UNIX for Advanced & Expert Users 4 03-20-2002 12:06 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 10-10-2005
Registered User
 

Join Date: Oct 2005
Location: singapore
Posts: 86
Question Pipe out ftp command to a file

hi there all the unix-gurus,

anyone can offer me some advise/help? i'm writing a ftp script and i need to spool out the output to a file but i'm facing some problems when i'm doing the following:

ftp -n <mail server> ${log_dir}/test_put.log << END
user <user_id> <password>
verbose
bin
# Before putting the A0 Data
pwd >> ${log_dir}/test_put.log
dir >> ${log_dir}/test_put.log

it gives me this output which i do not want:

drw-rw-rw- 1 ftp ftp 0 Oct 10 14:26 .
drw-rw-rw- 1 ftp ftp 0 Oct 10 14:26 ..

I don't see all the files listed.

Anyway to resolve this?

Thanks.
Reply With Quote
Forum Sponsor
  #2  
Old 10-10-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,613
When you do <<END you are sending the next lines into the ftp program. The ftp program knows what "dir" means while the shell does not. But the ftp program has no idea at all what "dir >> ${log_dir}/test_put.log" means. Yes, it knows "dir". But the rest of that lines is gibberish. Just do "pwd" and "dir". You are already sending the output of ftp into that log file.
Reply With Quote
  #3  
Old 10-10-2005
Registered User
 

Join Date: Oct 2005
Location: singapore
Posts: 86
Hi Perderabo,

Many thanks for the solution. It works perfectly fine. Thanks again =)
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0