From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,df15b12c467539a8 X-Google-Attributes: gidfee84,public From: patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii) Subject: Re: dos2unix/unix2dos file conversion Date: 1999/03/09 Message-ID: <7c3vqk$eu4@ds2.acs.ucalgary.ca>#1/1 X-Deja-AN: 453102476 References: <36e576d4.4636386@news.mtt.net> Organization: The University of Calgary Newsgroups: comp.unix.osf.osf1 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.