I would like to see line endings in old school sunos. I would prefer vi but any way you can think of would be appreciated. What are the options for seeing both Line Feed and Carriage Return?
I am using an old school vi.
: uname -a
SunOS ah57ndcub04031 5.11 11.4.71.170.2 sun4v sparc sun4v non-global-zone
: vi --version
VIM - Vi IMproved 9.0 (2022 Jun 28)
Included patches: 1-393, 395-2136
Modified by Solaris Userland Team
Compiled by the Solaris Userland build environment
This does not do anything in vi.
:set ffs=unix
This shows ^M in vi. Vi needs to be running.
:e ++ff=unix
If you put this in ~/.vimrc it will show ^M. Do not understand why :set ffs=unix does nothing.
set ffs=unix
This points out to you what vi thinks you are are using.
:set ff?
:set ff
One of the most surprising ones to me. My cookies.txt was created in notepad++ with windows file endings so expected to see ASCII text, with CRLF line terminators
: file cookies.txt
cookies.txt: ascii text
This is what I am used to seeing.
Unix:
$ file testfile1.txt
testfile.txt: ASCII text
"DOS":
$ file testfile2.txt
testfile2.txt: ASCII text, with CRLF line terminators
One of the few options that will show both Line Feed and Carriage Return. Line Feed = \n and Carriage Return = \r \n.
od -t c <filename>
od -c <filename>
Another option to see the Carriage Return.
less -u filename
One of the few options that will show both Line Feed and Carriage Return. 0D = Carriage Return and 0A = Line Feed. This is a hex dump so the numbers are different than what you expect.
xxd file name
Binary mode in vi will display ^M characters for carriage return. This does not work for some reason :set binary. I did check :help binary and it made it sound like it would work.
vim -b filename