sftp file upload problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sftp file upload problem
# 1  
Old 01-16-2009
sftp file upload problem

Hi All,

I am trying to upload a text file from HP unix to Windows tectia server using sftp, the text file shows with new line character after upload.

For EG : abc.txt file contains

123
456

aftre upload it shows as

123 456

i am using sftp version 2.0

TQ,
# 2  
Old 01-16-2009
So, when you upload the file, which in initial state has UNIX end of line, the file gets Windows end of line when you open it ? I think the server, SSHD Tectia, assumes that the file will be opened under Windows and automatically adds windows end-of-line. If that's not the case, the server doesn't correctly handles the CR-LF. As as last resort, you can use some windows utility to make Dos2Unix conversion.
# 3  
Old 01-16-2009
Thanks for your reply, it works with ux2dos in hp unix, but for this i need to add this step in my script to convert the file before uploading, is there any way to handle it like in ftp we can use either ascii or bin command.

However it works now withe ux2dos.

TQ
# 4  
Old 01-19-2009
Hi,

By using ux2dos the file has been successfully converted into dos format but at the end it also added one special character i think that is also a new line character, any idea how can it be removed automatically?

TQ
# 5  
Old 01-19-2009
Hi

I have checked the file in HP Unix after converting into ux2dos and found that all the text as ^M at the end of the text and finally it marked ^Z at the end of the file, this is appending the special character when I have opened it in Windows system.
How to delete this ^Z at the end automatically?

TQ,
Phani
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File upload message in SFTP

Hi, Below script is running on AIX 7.1 ( 7100-04-05-1720 version ) server. Recently OpenSSH version installed on server got updated from OpenSSH_6.0p1 to OpenSSH_7.5p1 version. After this update we do not receive any file upload message after put/mput command in SFTP. sftp -b - user@server... (1 Reply)
Discussion started by: Juggernaut
1 Replies

2. Shell Programming and Scripting

SFTP problem......File not getting from Remote server

Hi, We are using one unix script which is using sftp command and connect to remote server and get some file form remote server. some time after running this script we are not getting any file . Could you please tell us detailed validation that is there any problem with... (6 Replies)
Discussion started by: maheshkumar93@g
6 Replies

3. UNIX for Dummies Questions & Answers

[Solved] ls -l in CentOS 6.4 after upload using sftp

Hi everyone, Something rather interesting just happened to me. I uploaded a file to a server through sftp. I closed the connection and then logged on to the server via ssh. So far so good. When I typed ls -l in the remote server to retrieve a directory listing, the file that was previously... (2 Replies)
Discussion started by: gacanepa
2 Replies

4. IP Networking

Upload problem with traffic shaping though a Linux router.

So I want to limit the download and upload speed of a specific ip adress in a local network. To do this I are using a bach script running in a linux OS (Ubuntu 11.04). The issue here is that the upload shaper does not work. I have tried an alternate solution aswell though that does not work as... (0 Replies)
Discussion started by: martio09
0 Replies

5. Shell Programming and Scripting

Generate file and Upload to SFTP server.

Xperts, My requirement is something like this, I have a sql script which i need to embed in a shell. The sql (oracle) script will generate a .csv file in some Unix directory. the approximate file size is around 10 mb which i need to upload to an sftp server. My concern here is how to make... (5 Replies)
Discussion started by: Showdown
5 Replies

6. Shell Programming and Scripting

Expect Script for SFTP Upload

I am attempting to utilize an expect script (that is called from a parent bash script) to perform a file transfer over sftp. The script works except I cannot catch timeouts. I need to be able to tell in the parent bash script when the expect script has timed out, or completed successfully. It... (3 Replies)
Discussion started by: thaller
3 Replies

7. Shell Programming and Scripting

help to upload multiple files through SFTP

Hi Experts, Please help me to write the expect script for uploading multiple files in one shot . Below is my program that I have written. #!/usr/local/bin/expect -f #/home/kulbhushan/sftp_prog.sh # procedure to attempt connecting; result 0 if OK, 1 otherwise proc connect {passw} { expect... (1 Reply)
Discussion started by: kulbhushan
1 Replies

8. UNIX for Advanced & Expert Users

chrooted SFTP upload folder

Hi List, I have set up a chrooted SFTP setup following the instructions I found on tech republic: /blog/opensource/chroot-users-with-openssh-an-easier-way-to-confine-users-to-their-home-directories/229 I have successfully got it all working and I can download files when logged in via sftp... (0 Replies)
Discussion started by: landossa
0 Replies

9. Ubuntu

I want to upload file on remote machine in noninteractive mode through SFTP

Hi All, I want to upload file through SFTP in non interactive mode on remote server. please tell me what will have to do in oreder to do SFTP . (1 Reply)
Discussion started by: kulbhushan
1 Replies

10. Shell Programming and Scripting

How to Write sftp through "expect" for file upload ?

Hi Experts , I am new to unix programming please tell me how to write expect and hoe to call it for automated file upload process. help me really ! (0 Replies)
Discussion started by: kulbhushan
0 Replies
Login or Register to Ask a Question