Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Nov 2001 23:29:19 -0500
From:      "David Loszewski" <stealth215@mediaone.net>
To:        <freebsd-questions@freebsd.org>
Subject:   RE: ^M on end of lines
Message-ID:  <000e01c164e9$4592a300$3000a8c0@sickness>
In-Reply-To: <Pine.BSF.4.21.0111031148300.93546-100000@ren.sasknow.com>

next in thread | previous in thread | raw e-mail | index | archive | help
So then how do I strip it of the '^M's then? Lol, this is the biggest
pain in the ass, and I'm not a complete newbie. If I do 'wget' I get the
same thing sometimes so I'm starting to think that there's something
wrong with the configs in the system.  Ideas on where I should start
looking?

Dave

-----Original Message-----
From: Ryan Thompson [mailto:ryan@sasknow.com]=20
Sent: Saturday, November 03, 2001 12:54 PM
To: Brian T.Schellenberger
Cc: David Loszewski; freebsd-questions@FreeBSD.ORG
Subject: Re: ^M on end of lines

Brian T.Schellenberger wrote to David Loszewski:

> On Friday 02 November 2001 19:59, you wrote:
> > Maybe the question I should be asking instead is, is it normal to
see a
> > crap load of '^M's in a file in FreeBSD?
>=20
> Never happens to me (except with MS-DOS files, and of course that
happens in=20
> Linux as well).  So something is configured in a screwy way on our
system if=20
> it's any different from Linux.
>=20
> But here's the deal on FTP, as I understand it:
>=20
> in text mode, FTP uses the MS-DOS conventions (it adds ^Ms), so if you
> run FTP on Linux in text (ascii) mode but the FTP on FreeBSD in binary
> mode, then Linux will add the ^Ms and FreeBSD won't strip 'em.

Not the case.. Unless maybe your FTP is broken?


> If you are running *nix-to-*nix, then FTP in binary mode on both ends;
> if it's a text file you can use text mode on both ends.  Sounds like
> somehow the FTPs aren't communicating and they are in different modes.

> Of course that's not supposed to be possible, and I've never seen it,
> but it sounds like what might be happenening to you anyway.

Actually, what ASCII mode is supposed to do, is, when transferring text
files, convert to the platform specific text format. (Which really means
the receiver strips or adds the ^M). This instruction is actually in our
training manual for new employees developing code on Windows machines
who
need to transfer via FTP. USE ASCII MODE FOR ASCII FILES. :-)

- Ryan


>=20
> >
> > Dave
> >
> >
> > -----Original Message-----
> > From: owner-freebsd-questions@FreeBSD.ORG
> > [mailto:owner-freebsd-questions@FreeBSD.ORG] On Behalf Of undergra
> > Sent: Friday, November 02, 2001 7:28 PM
> > To: Andreas Ntaflos; David Loszewski
> > Cc: freebsd-questions@FreeBSD.ORG
> > Subject: RE: ^M on end of lines
> >
> > tr -d "\015" < input-file > output-file
> > ----- Mensaje original -----
> > De: "Andreas Ntaflos" <ntaflos.andreas@gmx.net>
> > Para: "David Loszewski" <stealth215@mediaone.net>
> > CC: <freebsd-questions@FreeBSD.ORG>
> > Enviado: s=E1bado, 03 de noviembre de 2001 0:44
> > Asunto: Re: ^M on end of lines
> >
> > > On Fri, Nov 02, 2001 at 05:43:18PM -0500, David Loszewski wrote:
> > > > Yea, but then I have to do that to all the files
> > > > Not pretty when you have a 100 files
> > > >
> > > > Dave
> > > >
> > > >> a simple fix after dl is to open it up in vi and do
> > > >>
> > > >> :%s,^V^M,,g
> > > >>
> > > >> -r
> > >
> > > The following perl command issued on the CLI will get
> > > rid of these annoying ^Ms.
> > >
> > > # perl -e -i -p 's/\r\n/\n/s' filename
> > >
> > > you can use wildcards too.
> > >
> > > There are also ports to solve these problems, like dos2unix.
> > >
> > > regards
> > > --
> > > Andreas "ant" Ntaflos
> > > ntaflos.andreas@gmx.net
> > > Vienna, AUSTRIA
> > >
> > > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > > with "unsubscribe freebsd-questions" in the body of the message
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
>=20
>=20

--=20
  Ryan Thompson <ryan@sasknow.com>
  Network Administrator, Accounts

  SaskNow Technologies - http://www.sasknow.com
  #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2

        Tel: 306-664-3600   Fax: 306-664-1161   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000e01c164e9$4592a300$3000a8c0>