SFTP in ASCII mode


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP in ASCII mode
# 1  
Old 01-15-2009
SFTP in ASCII mode

Hi

Copying a file from Unix (Solaris) to a windows server using sftp. File arrives with carriage returns and line feeds screwed (binary file transfer). Is there a way to get these to copy properly without having to edit or messa about with the file on the windows side. I know with FTP you can set the type of transfer using the ftp commands 'binary' or 'ascii'.

Billy
# 2  
Old 01-15-2009
Quote:
Copying a file from Unix (Solaris) to a windows server using sftp. File arrives with carriage returns and line feeds screwed (binary file transfer)....
Not quite, nothing to do with binary file transfer...
Dos/windows does not manage the EOL the same way as UNIX does and so there are commands to convert before transfering like dos2ux and ux2dos...

Addendum dos2ux etc.. were for HPUX and some AIX, for SOLARIS you would use dos2unix and unix2dos (look at the man pages...)

All the best

Last edited by vbe; 01-15-2009 at 11:32 AM.. Reason: Addendum...
# 3  
Old 01-15-2009
Thanks for reply but the file has the same screwed line ends if I FTP the file having issued the binary commad first. If I FTP it without setting it to binary transfer (ie. default ascii), it copies to dos/windows ok. Is there no way to have sftp transfer in ascii mode.??

I've never heard of ux2dos etc.....wher do they come from..??
# 4  
Old 01-15-2009
lus97:/export/home/vbe $ uname -r
5.10
lus97:/export/home/vbe $ whereis unix2dos
unix2dos: /usr/bin/unix2dos /usr/man/man1/unix2dos.1

Look at the man pages...

All the best
# 5  
Old 01-15-2009
VBE.....thanks, using unix2dos before sftp transfer and works......
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

WARNING! 16126 bare linefeeds received in ASCII mode

I am doing FTP from a server and getting below ERROR:WARNING! 16126 bare linefeeds received in ASCII mode File may not have transferred correctly. I looked into web and found that I may need to change the mode to binary, but when I do so the records are not in readable format...So need the file... (10 Replies)
Discussion started by: joshilalit2004
10 Replies

2. UNIX for Dummies Questions & Answers

SFTP in non-interactive mode without password

Hello all, can we SFTP to the destination server in a non-interactive mode with out estbalishing the public key of origination server in the destination server? meaning i want to harcode the password as part of the below script or as an variable? Please let me know if there is any better way to... (2 Replies)
Discussion started by: Ariean
2 Replies

3. Shell Programming and Scripting

Ascii Mode appending extra records to csv file

I am relatively new to this forum and Unix scripting. ksh script: part 1 :will call a PL\SQL program will create 3 CSV file at the unix directory. part 2 : will sftp the files to the EFT server. Once the EFT server receives these file , it will transfer them to a shared windows folders. ... (3 Replies)
Discussion started by: developerpa
3 Replies

4. Shell Programming and Scripting

File permission check in SFTP mode

Hi, I have requirement to get a file from a remote location using SFTP only if the file has read/write permission either to the user or to the group. Currently i m taking the ls of the required file and storing it in a flat file to check the file permission. Please advice is there any... (3 Replies)
Discussion started by: ravin
3 Replies

5. Shell Programming and Scripting

SFTP with ASCII file transfer

Hello - I have text file and need to load the data in Oracle through sqlloader. I need to move this file to unix server and load into oracle. When i SFTP(unfortunately i do not have FTP) to unix box, each line is appended with ControlM character... since it is transferring in BINARY... (4 Replies)
Discussion started by: govindts
4 Replies

6. Shell Programming and Scripting

SFTP file transfer mode question

I am having trouble viewing a file in ASCII after doing a 'get' using SFTP. It appears to have come across as machine language. Does the file have to be in ASCII format prior to the 'get' or is there a way to convert it to ascii after I get it onto my server? I have read where the secure file... (0 Replies)
Discussion started by: wsiefkas
0 Replies

7. Shell Programming and Scripting

How to find whether a file is transferred thro bin or ascii mode?

Hi Gurus, I need to find out, if i have transferred a file from ftp thro bin mode or ascii mode. Say if i have a file called "dec.sh"( u shuld normally transfer thro ascii mode). How can i find out that dec.sh is tranferred from ftp server thro ascii mode or bin mode? Any help would be... (9 Replies)
Discussion started by: Ashok_oct22
9 Replies

8. UNIX for Advanced & Expert Users

Sftp in Batch Mode

Hi, I am trying to do sftp a file from one server to another solaris server. Both are sftp enabled. I have generated the rsa key in local server and did a ftped the public key to the remote server and added that in the authorization keys file. Then i try to run the below command using a... (2 Replies)
Discussion started by: sivaemn
2 Replies

9. UNIX for Advanced & Expert Users

Converting ASCII to Binary mode

Dear All, Business Users are transfering ( FTP ) a CSV file into the IBM AIX box with transfer mode as ASCII. But I want to convert the CSV file from ASCII mode into binary mode, as my script expects file in binary mode. Is it possible to do through Unix commands? Thanks in Advance, RK (1 Reply)
Discussion started by: srajeshmca
1 Replies

10. SCO

compressed file was ftpied in ascii mode needs recovery

I am unbale to uncompress a file which was compress then moved to another pc in ascii mode instead of binary mode. Is there any way to recover it. Please help us. While uncompress it is giving corrupt input. (3 Replies)
Discussion started by: raj2610
3 Replies
Login or Register to Ask a Question