Results 1 to 2 of 2
Hi All,
I have problem with FTP.
When i am transferring a shell script from Windows to Solaris i am getting some extra characters in the Script.
#^M
# Program: ...
- 03-12-2008 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 7
Ftp Problem
Hi All,
I have problem with FTP.
When i am transferring a shell script from Windows to Solaris i am getting some extra characters in the Script.
#^M
# Program: csv_to_sas_ds.ksh^M
# Author: Rajani ^M
#^M
Can some one help me regarding the same.
Regards,
Rajani.
- 03-29-2008 #2
Hi,
^M is a line feed character. UNIX/Linux systems use only the carriage return (CR; ASCII 15) character at the end of a line, Mac's use line feed (LF; ASCII 32), and windows uses carriage return and line feed (CRLF)
Inside vim do this:
In the above, ^M is an excape sequence and must be created using Ctrl+V then Ctrl+M. If you type carot-M it will not work.Code::%s/^M$//g
Or on the command line using tr:
Or using awk:Code:tr -d '\15\32' < winfile.txt > unixfile
Or using sedCode:awk '{ print $0 "\r"}' unixfile > winfile.txt
Or using perlCode:sed 's/\r$//' winfile > unixfile
Code:perl -p -e 's/\r$//' < winfile.txt > unixfile


Reply With Quote
