Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!oddjob!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: Invisible Ascii with VI Message-ID: <8807@mimsy.UUCP> Date: Mon, 28-Sep-87 09:31:47 EDT Article-I.D.: mimsy.8807 Posted: Mon Sep 28 09:31:47 1987 Date-Received: Tue, 29-Sep-87 04:28:42 EDT References: <258@unx1.UUCP> <469@devon.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 26 Keywords: vi In article <469@devon.UUCP> paul@devon.UUCP (Paul Sutcliffe Jr.) writes: >Your "1,$s/^V^M$//" didn't work because the search pattern didn't match >anything in your text file. You asked vi to find all lines where the >character just before the end of line ($) was a carriage-return. This >pattern will not match because the lines in your text were terminated >by a CR/LF pair, so there was a line-feed between the "^M" and the "$". Nope. A linefeed is a Unix newline; CR-LF pairs form a literal control-M followed by a newline. vi breaks a file apart at newlines (so as to create a series of lines), and, internally, does not carry around the newlines (linefeeds) at all. There is no line-feed between the ^M and the $-end-of-line, and in fact, typing the characters : % s / ^V ^M $ / / works fine for me. Of course, this could be a bug in other versions of vi. (At this very moment, I am running `Version 3.7, 6/7/85'---so says `:ver'.) (Going the *other* way---adding ^Ms---is another matter entirely.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris