Hebrew character convert error while put thru ftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Hebrew character convert error while put thru ftp
# 1  
Old 01-02-2018
Hebrew character convert error while put thru ftp

Hi all ,
i have a script which cp xml files from linux to other server thru ftp
my xml file contains charcters in hebrew . my script is
Code:
#!/bin/bash
HOST="....."
USER="....."
PASSWORD="..."
cd /usr2/app/naama/
filelist='find . -mmin -60 | tail -n +2 | awk -F "/" '{print $2}' | grep xml'
for i in $filelist; do
ftp -p -n $HOST << EOF
user $USER $PASSWORD 
cd /dest/files4/
put $i
EOF
done

the encoding of the file is "UTF-16"
when i'm trying to open the file it's gives me undefined charcters insted of the hebrew .
please your help
thanks in advanced ,
Naama

Last edited by joeyg; 01-02-2018 at 01:25 PM.. Reason: code tags
# 2  
Old 01-02-2018
try adding before put $1 line: bin
# 3  
Old 01-02-2018
If you want ftp to not change the file content then you need to use binary transfer instead of ascii. So try:
Code:
ftp -p -n $HOST << EOF
user $USER $PASSWORD 
binary
cd /dest/files4/
put $i
EOF

# 4  
Old 01-03-2018
The script is still coverting Hebrew to Jibrish

There are some cases when the script does Error converting from Hebrew to Jibrish.Even Though we put the Binary Command .
Code:
ftp -p -n $HOST << EOF
user $USER $PASSWORD 
binary
cd /dest/files4/
put $i
EOF

Please you help .
Thanks .

Last edited by naamas03; 05-02-2018 at 07:55 AM.. Reason: still Have problems woth script
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies

2. UNIX for Beginners Questions & Answers

How to put a 80 character limit on a long topic line in markdown?

I have a topic line in markdown that spans more than 80 characters that i need to add a line break. Markdown is simply treating the line break as a brand new line instead of continuing as a topic line. Eg: # This is a very long line Markdown interprets it as This is a very long line (4 Replies)
Discussion started by: dragonpoint
4 Replies

3. Shell Programming and Scripting

Hebrew converted into jibrish while put command

HI Friends , I have a script which cp xml files from linux to other server thru ftp my xml file contains charcters in hebrew although , the command Binary exists in the script . the files contains Undefined Charcters after converting. script : ftp -p -n $HOST << EOF user $USER $PASSWORD... (9 Replies)
Discussion started by: naamas03
9 Replies

4. UNIX for Dummies Questions & Answers

Put a character before each line

i have few lines: 3 4 5 6 #72 9 9 9 4 5 67 8 9 #4 6 8 92 1i want to put '#' before each line. i used this awk '{print "#" $0;}it gave #3 4 5 6 ##72 9 9 9 #4 5 67 8 9 ##4 6 8 92 1but i want the output like this: #3 4 5 6 #72 9 9 9 #4 5 67 8 9 #4 6 8 92 1I want to avoid the character... (5 Replies)
Discussion started by: arindam guha
5 Replies

5. Shell Programming and Scripting

Awk: sed help: How to put bracket in the last character.

Hi Experts, A quick question. - How to put a 2nd bracket in the last character of the input string. a=blah or a=1234 or a=anything Desired output to be : bla or 123 or anythin What I have tried is not working: echo $a| sed 's/$//' blah Thanks a lot. (3 Replies)
Discussion started by: rveri
3 Replies

6. Programming

Macro to put single quotes around character

Dear Mates, I am trying to write a macro to replace with its arguments with singles quotes around each argument. #define DECR(a,b,c,d,e) decr('a','b','c','d','e') if the usage is DECR(k,e,y,s,\0) I want it to be replaced with the following decr('k','e','y','s','\0') However it... (2 Replies)
Discussion started by: tamil.pamaran
2 Replies

7. UNIX for Dummies Questions & Answers

FTP put command problem

Hello,I am trying to put something on the ftp server using the put command. Whenever I try, I get this error: ftp> put SIMS.war local: SIMS.war remote: SIMS.war 200 PORT command successful 553 Can't open that file: Permission denied I have set rwx for all on that file and I still am... (3 Replies)
Discussion started by: mojoman
3 Replies

8. Shell Programming and Scripting

Interactive ftp get/put

Hi All, I'm trying to get this to work but when I execute it I get the following error ./ftp_upload.sh: line 78: syntax error: unexpected end of file. This was working before I expanded the script and had the here document part directly below within a function. Can anyone spot what I've... (5 Replies)
Discussion started by: darrenm
5 Replies

9. Shell Programming and Scripting

how to put file from one ftp to another ftp location

hi, I have one file located in ftp.I want to place that file in different ftp location. Up to now i am doing it manually using get command and copying that file in to my local system and then putting that file in different ftp using put command. now i want to automate that using shell... (1 Reply)
Discussion started by: prasee
1 Replies

10. UNIX for Advanced & Expert Users

Put fails during FTP

Hi All, I am facing a while i use mput to the server. Actually i have data on client machine which is windows XP. The data is near to 1GB. I have zipped the data. I can ftp and connect to Server(Which has Fedora 4 running). but when i do mput *.zip it gives an error. I tried to put in a... (2 Replies)
Discussion started by: prakash.kudreka
2 Replies
Login or Register to Ask a Question