Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

There can be no twisted thought without a twisted molecule. -- R. W. Gerard


devel / comp.unix.shell / Re: About the end of line symbols displayed by `cat -ve'.

SubjectAuthor
o Re: About the end of line symbols displayed by `cat -ve'.Lew Pitcher

1
Re: About the end of line symbols displayed by `cat -ve'.

<sfr7b2$8m6$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4250&group=comp.unix.shell#4250

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: About the end of line symbols displayed by `cat -ve'.
Date: Sat, 21 Aug 2021 15:49:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <sfr7b2$8m6$1@dont-email.me>
References: <89f76fde-132b-4080-affc-a951da8d72bdn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 21 Aug 2021 15:49:54 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4c048f36795a1ac53ad121102537a23a";
logging-data="8902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oTAidBSw8/tFnSv8Ri2sflHKk0F8S8xo="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:9KDxSNMgnBAczax1TeJgbsjRW0s=
 by: Lew Pitcher - Sat, 21 Aug 2021 15:49 UTC

On Sat, 21 Aug 2021 06:55:45 -0700, hongy...@gmail.com 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"

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor