Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii)
Subject: Re: dos2unix/unix2dos file conversion
Date: 1999/03/09	[thread overview]
Message-ID: <7c3vqk$eu4@ds2.acs.ucalgary.ca> (raw)
In-Reply-To: 36e576d4.4636386@news.mtt.net

John Allen (john.allen@geonet-tech.com) wrote:
: Anybody know where I could download a dos2unix/unix2dos
: file conversion set of utilities for Digital Unix?

Download? What do you need to download 'em for?

This is dos2unix:

/bin/sed -e 's/^M$//' -e '$s/^Z//'

This is unix2dos:

/bin/sed -e 's/$/^M/' -e '$a\^J^Z^J'

In both cases, ^M, ^Z, and ^J are corresponding control characters,
which can be entered in vi (and many interactive shells) using the 
Control-V escape. 

Regards,

/Serge.P

P.S. Don't try this in csh, tcsh, or any other shell with broken
apostrophe handling.



  reply	other threads:[~1999-03-09  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-09  5:00 dos2unix/unix2dos file conversion John Allen
1999-03-09  5:00 ` Serguei Patchkovskii [this message]
1999-03-10  5:00 ` Bob Koehler
1999-03-10  5:00 ` Nikola Milutinovic
1999-03-10  5:00   ` Dr. J.C.Hill
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox