🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1212

Re: changing a ! to a \nC where \n is a newline

#1212
From: Bob McGowen x4312 dept208
Date: Thu, 20 Sep 1990 22:15
30 lines
1982 bytes
In article <13894@hydra.gatech.EDU> gt0178a@prism.gatech.EDU (BURNS,JIM) writes:
>in article <2962@wyse.wyse.com>, bob@wyse.wyse.com (Bob McGowen x4312 dept208) says:
>> In article <1990Sep18.023649.1336@virtech.uucp> cpcahil@virtech.UUCP (Conor P. Cahill) writes:
>>   >:1,$s/!/<ctrl>-V<Return>C/g	(this will appear as:1,$s/!/^MC/g)
>> This will put carriage returns in the file, not newlines.
>
>I thought so too at first, but it works on Dynix and SunOS 4.0.3. Probably
>has something to do w/ the equivalent of an 'stty icrnl' mode that vi sets
>when executed.

Interesting.  When I get a copy of a DOS format text file (in native format)
and look at it with vi, each line has a "^M" at its end.  My file command
reports this file as a DOS format text file.  If I take a UNIX text file
into vi and do a global substitute:

	%s/$/^-V<CR>/    #  what I see: %s/$/^M/

I get ^M displayed at the end of each line.  Saving this and then running
the file command on it tells me I have a DOS format text file, ie one
with carriage return/linefeed at the end of each line.

If the input ^M were made into a linefeed the file should still be UNIX
only double spaced (in this example).  So under XENIX 2.[23].x and AT&T
UNIX SysV/386 Rel 3.2 there is no conversion of cr to nl set by vi.
Other systems may do this and I would be interested in knowing which ones.

Bob McGowan  (standard disclaimer, these are my own ...)
Product Support, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob@wyse.com
Technical Details
Message-ID: <2965@wyse.wyse.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!mips!wyse!bob
References: <2962@wyse.wyse.com> <13894@hydra.gatech.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!mips!wyse!bob
From: bob@wyse.wyse.com (Bob McGowen x4312 dept208)
Newsgroups: comp.unix.shell
Subject: Re: changing a ! to a \nC where \n is a newline
Message-ID: <2965@wyse.wyse.com>
Date: 20 Sep 90 22:15:43 GMT
References: <2962@wyse.wyse.com> <13894@hydra.gatech.EDU>
Sender: news@wyse.wyse.com
Reply-To: bob@wyse.UUCP (Bob McGowen x4312 dept208)
Organization: Wyse Technology
Lines: 30