If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > ftp problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-23-04, 13:25
mvillan mvillan is offline
Registered User
 
Join Date: Dec 2003
Location: Ogden Utah
Posts: 34
ftp problem

I have a critical problem where during the ftp transfer one of my files is being assigned the \n character at then end of each segment. If you were to vi the file you cannot see it but when you do the od -xc < filename> I can see that the \n is at the end of each segment.

What command during the ftp session can I use so it does not pass \n character along and or what command should I use to remove this prior to the ftp session. I have tried the sed 's/\012//'g or sed 's/012//'g on the file and it is not removing it . Do I have the right syntax??


ftp -inv <<EOF > $FLOG_OUT
open $HOST
user $ID $PSW
prompt
lcd $out
mput [A-Z0-9]*
bye
EOF
__________________
mvilla
Reply With Quote
  #2 (permalink)  
Old 06-23-04, 13:36
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
It may be defaulting to ASCII transfer, use the 'BINARY' ftp command.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #3 (permalink)  
Old 06-23-04, 14:53
mvillan mvillan is offline
Registered User
 
Join Date: Dec 2003
Location: Ogden Utah
Posts: 34
Thumbs up ftp

Ok I took your suggestions and it worked! Wow!!!! What relief!!! Can you explain to me why?
__________________
mvilla
Reply With Quote
  #4 (permalink)  
Old 06-23-04, 15:35
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
ftp will transfer files in ASCII mode (text) and in some cases add a carriage return after each record (block), BINARY mode prevents ftp from doing any translation.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On