> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[email protected]] On Behalf Of Paul Gilmartin
> Sent: Friday, March 19, 2010 2:10 PM
> To: [email protected]
> Subject: Re: FTP problem
> 
> 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

#!/bin/sh
# UNIX text to DOS
exec sed -e 's/$/\r/' "$@"

#!/bin/sh
#DOS to UNIX
exec sed -e 's/\r$//' "$@"


\n is LF
\r is CR

----------------------------------------------------------------------
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