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:
- Using
cat build_test.sh
it outputs nothing. - Using
more build_test.sh
it outputs:cd - install/llvm-obj/tools/TEST_TOOL/Y_TOOL/$1 test.cpp
- 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?