On Fri, 19 Mar 2010 11:13:26 -0400, Shmuel Metz (Seymour J.) wrote:
>
>>There is a pair of GNU utilities called dos2unix and unix2dos which fix
>>up the line endings.
>
>I suggest checking whether those are included with the ported tools.
>
Be my guest:


#! /bin/sh

# UNIX text to DOS -- convert <LF> to <CR><LF>

exec sed -e 's/$/^M/' "$@"


#! /bin/sh

# DOS text to UNIX -- convert <CR><LF> to <LF>

exec sed -e 's/^M$//' "$@"


(The apparent "^M" must be actual CR characters; I don't
know how to represent them in sed syntax.)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to