[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How convert PC text to UNIX ascii



-----BEGIN PGP SIGNED MESSAGE-----

On Sat, 28 Aug 1999, [iso-8859-1] André Bell wrote:

> Here's one solution from http://ume.med.ucalgary.ca/usenet/Linux/0053.html:
> 
> -------------------- save as dos2unix --------------------------------- 
> #!/bin/sh 
> sed 's/^M//' $1 
> ----------------------------------------------------------------------- 
> -------------------- save as unix2dos --------------------------------- 
> #!/bin/sh 
> sed 's/$/^M/' $1 
> ----------------------------------------------------------------------- 
> 
> 
> Note that the `^M' has to be produced by pressing `Ctrl-V Ctrl-M' in vi, or 
> `Ctrl-QCtrl-M' in emacs. Then you can do, e.g., `dos2unix < unixfile > 
> dosfile' and `unix2dos < unixfile > dosfile'. 
>        ----- end ------
> 
> Those look like perl scripts. If so it's just that I'm unfamiliar with the
> SED command that is throwing me off. I'll try each as a perl script anyways
> just to be sure.

Actually, they're shell scripts. They use /bin/sh to interpret, while perl
uses /usr/bin/perl. sed is a program whose main feature is similar to
Perl's s/// command. man sed for more info.

- -- 
  finger for PGP public key.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv

iQCVAwUBN8guZr7M/9WKZLW5AQG5XQP/SLXfGWJY2ZfohGPPXT4uaorDPe5WrVSh
Qi4cFNnpkZx9D1HhQ3dwUb+8t8RXf5tkamPV42LZ6410KhV/r0RjhOJ2O3gncOAF
h/i6ivhu+hedjxY99mHb0nTJrBrYO7KLc8a35dFlH4NG7r9lrasbWJNPAHUYAWZr
XQ2PMsxlyUI=
=PAXF
-----END PGP SIGNATURE-----


Reply to: