Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9053381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:24:31+00:00 2026-06-16T13:24:31+00:00

Firstly I would say that I have read this post however I still have

  • 0

Firstly I would say that I have read this post however I still have problems for the CR line terminators.

There is a file called build_test.sh, I edited in leafpad and it can be displayed right in Vim:

cp ~/moonbox/llvm-2.9/lib/Transforms/MY_TOOL/$1 test.cpp 
cd ~/moonbox/llvm-obj/tools/TEST_TOOL/
make
make install
cd -

However:

  1. Using cat build_test.sh it outputs nothing.
  2. Using more build_test.sh it outputs:cd - install/llvm-obj/tools/TEST_TOOL/Y_TOOL/$1 test.cpp
  3. Using less build_test.sh it outputs: cp ~/moonbox/llvm-2.9/lib/Transforms/MY_TOOL/$1 test.cpp^Mcd ~/moonbox/llvm-obj/tools/TEST_TOOL/^Mmake^Mmake install^Mcd -

The result of file build_test.sh is:

build_test.sh: ASCII text, with CR line terminators

Following this post, the ^M no longer exists however there is no more line break 🙁
The result of file build_test_no_cr.sh is now:

build_test_nocr.sh: ASCII text, with no line terminators

The solution can be seen here.

However I still would like why cat displays nothing and more displays so odd result. In addition why dos2unix and set fileformat=unix in Vim fails for this case.

ps: I guess that maybe my editor(Vim or leafpad?) generates only \r rather \n for the newline. How can it be so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:24:32+00:00Added an answer on June 16, 2026 at 1:24 pm

    Simple \r terminators for newlines are “old Mac” line terminators, it is strange that an editor in 2012+ even generates files with such line terminators… Anyway, you can use the mac2unix command, which is part of the dos2unix distribution:

    # Edits thefile inline
    mac2unix thefile
    # Takes origfile as an input, outputs to dstfile
    mac2unix -n origfile dstfile
    

    This command will not munge files which have already expected line terminators, which is a bonus. And the reverse (unix2mac) also exists.

    Note that mac2unix is the same as dos2unix -c mac.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My first post - firstly have to say that this site is great -
Firstly, I would like to say that I have tested if my link to
Firstly, I have to say that I am new in Wicket. I would like
Firstly, I do not have any malicious intent out of this question. I would
Firstly I would like to say that I am quite new to Spring (in
Firstly, I will say that I come from the Java world (this is important,
Let's say I have some email: some_email@yahoo.com . Firstly I would want to remove
I would like to continue the discussion from this post: GPX Schema validation problems
Firstly, I would like to say that I don't mean the full path, what
Lets say I have a method that is constantly receiving input every 10ms, adds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.