On Sat, 21 Aug 2021 06:55:45 -0700,
[email protected] wrote:
See the following testing:
$ cat -ve aaa
bla^M$
Why don't the end of line symbols displayed as `^M^J'?
Because unix tools expect text lines to end with the ^J
LineFeed character, and the cat(1) -v option will
"use ^ and M- notation, EXCEPT for LFD (linefeed) and
TAB".
So, you don't get to see the ^J at the end of a unix text
line with the cat(1) -v option.
However, the cat(1) -E option (invoked when you specified
-e) will
"display $ at end of each line"
where the ^J unix text line terminator would appear.
As to why cat(1) gives you ^M$ instead of just $, it appears
that you fed cat(1) with an MSDOS/MSWindows plain text file,
and MSDOS/MSWindows terminates each text line with the ASCII
character pair of Carriage Return (^M) followed by LineFeed
(^J). cat(1) doesn't speak MSDOS/MSWindows, and knows nothing
of it's quirks.
HTH
--
Lew Pitcher
"In Skills, We Trust"
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)