Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Jun 2001 01:43:43 -0400
From:      Jim Conner <jconner@enterit.com>
To:        Andrew Hesford <ajh3@usrlib.org>
Cc:        bsdnewbie bsdnewbie <bsdnewbie@hotmail.com>, freebsd-questions@freebsd.org
Subject:   Re: __ how to eliminate "^M" in ASCII files.
Message-ID:  <5.1.0.14.0.20010608013945.02504e90@mail.enterit.com>
In-Reply-To: <20010607215708.A1428@core.usrlib.org>
References:  <F2895sFmShG3ESvUC9y000187f7@hotmail.com> <F2895sFmShG3ESvUC9y000187f7@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
:)  Thats what this was:

$(locate dos2unix | head -1) file1 > file2

or

$ sed 's/\015//g' file1 > file2


But I would like to change it a lil:

$ [ -z $(locate dos2unix | head -1) ] && sed 's/\015//g' file1 > file2 || 
dos2unix file1 > file2

This should be able to tell whether or not dos2unix is even there. Lets 
just hope there isn't a man page only installed without the binary.

:)

- Jim

At 09:57 PM 6/7/2001 -0500, Andrew Hesford wrote:
>On Fri, Jun 08, 2001 at 10:17:51AM +0800, bsdnewbie bsdnewbie wrote:
> > Is there any tool can eliminate "^M" in text files?
> > Thanks in advance.
> >
> > best regards,
> > steven
>
>Everybody comes up with these home-brewed solutions.
>
>Has everyone forgotten about the old "unix2dos" and "dos2unix"
>utilities? It's in the ports, /usr/ports/converters/unix2dos.
>
>--
>Andrew Hesford
>ajh3@usrlib.org
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message


- Jim
- NOTJames
- jconner@enterit.com

- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- | Today's errors, in contrast:                                           |
- | Windows - "Invalid page fault in module kernel32.dll at 0032:A16F2935" |
- | UNIX    - "segmentation fault - core dumped"                           |
- | Humans  - "OOPS, I've fallen and I can't get up"                       |
- --------------------------------------------------------------------------
- (To view this properly use a non-proportional font in your MUA)


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?5.1.0.14.0.20010608013945.02504e90>