From owner-freebsd-questions Thu Oct 10 10:48:32 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA05721 for questions-outgoing; Thu, 10 Oct 1996 10:48:32 -0700 (PDT) Received: from phoenix.volant.org (root@phoenix.volant.org [205.179.79.193]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id KAA05709 for ; Thu, 10 Oct 1996 10:48:29 -0700 (PDT) From: patl@asimov.volant.org Received: from asimov.volant.org (asimov.phoenix.volant.org [205.179.79.65]) by phoenix.volant.org (8.7.5/8.7.3) with SMTP id KAA29629; Thu, 10 Oct 1996 10:46:35 -0700 (PDT) Received: by asimov.volant.org (5.x/SMI-SVR4) id AA27996; Thu, 10 Oct 1996 09:51:40 -0700 Date: Thu, 10 Oct 1996 09:51:40 -0700 Message-Id: <9610101651.AA27996@asimov.volant.org> To: hmmm@alaska.net, kuku@gilberto.physik.rwth-aachen.de Subject: Re: MS-DOS text files in UNIX Cc: jsigmon@www.hsc.wvu.edu, randyd@nconnect.net, questions@FreeBSD.org Reply-To: patl@Phoenix.volant.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: RtzB66vNt29+nKQJEWjYsw== Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk |> hmmm writes: |> > On Tue, 24 Sep 1996, Jeremy Sigmon wrote: |> > |> > > > I've read numerous things about adding the CR-LF back into text files |> > > > for use with DOS, but what about the other way?? Is there a way to |> > > > remove |> > > > that annoying ^M from a DOS text file under FBSD? I've tried many |> > > > things |> > > > but nothing short of removing them one-by-one seems to work. |> > |> > apple/mac uses CR |> > dos/win uses LF/CR |> dos/win uses CR/LF |> VMS uses CR/LF |> > unixes use LF No, actually unix uses NL (New Line), not LF (Line Feed). It just happens that they both have the same encoding. The difference is in interpretaton and goes back to the ASCII standards of the late 60's. According to the standard (which at that time was based on printers and printing terminals), CR means go to the beginning of the current line, LF means move to the current horizontal position in the next line, and NL means move to the beginning of the next line. LF and NL have the same encoding primarily because devices built to an earlier version of the standard disagreed on how that code should be interpreted. (The earlier standard was unclear on that detail.) In any case, CR/LF, LF/CR, and NL are all legitimate standard end-of-line indicators. The Apple CR is not. Unix chose NL for brevity and clarity. (Otherwise what does a lone LF or CR mean in the midst of a text file?) MS-Windows uses CR/LF because MS-DOS used CR/LF because CP-M used CR/LF. I don't know why CP-M used CR/LF; but if I had to guess, I would suspect that the original developer(s) were using a printer that subscribed to the CR/LF interpretation. -Pat P.S. Yes, I know that this reply is -way- late; but I just got the cycles to catch up on this mailing list for the first time in weeks...