Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: Ftp Problem

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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.

    # Program: csv_to_sas_ds.ksh^M
    # Author: Rajani ^M

    Can some one help me regarding the same.


  2. #2

    ^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.

    Or on the command line using tr:
    tr -d '\15\32' < winfile.txt > unixfile
    Or using awk:
    awk '{ print $0 "\r"}' unixfile > winfile.txt
    Or using sed
    sed 's/\r$//' winfile > unixfile
    Or using perl
    perl -p -e 's/\r$//' < winfile.txt > unixfile
    Linux user 439038 | Ubuntu user 20892

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts