Rafael Sevilla <[EMAIL PROTECTED]> writes:

> Why use vi when he could far more easily do the same with sed? Would
> be a lot faster too, especially if the files are in any way large:
>
> sed -e 's/\r$//' doslineending-file >unixlineending-file

Change dos.*file and unix.* file to $1 and $2, prepend a #!/bin/sh on
that, and save it as bin/dos2unix, and there you go.

> To go the other way:
>
> sed -e 's/$/\r/' unixlineending-file >doslineending-file

Same, this is bin/unix2dos.

Cheers,

Zakame


-- 
Zak B. Elep
[EMAIL PROTECTED]
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to