[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Jan 2003 ]

Re: [edlug] dos --> nix



On Thu, 16 Jan 2003, Andrew Beames wrote:

> Up to now I've been using a script to translate the files
> 	e.g.	tr -d '\r' < $file > $file.x
> so that 'diff' doesn't show up too many changes, but I don't know how to
> script in the end-of-line. So I've been manually editing the files that
> 'diff' has a problem with; adding a new line; and rerunning the script.

There's a util called dos2unix which should handle this comprehensively.

> Anyway, main question is how I can automate the new-line task. Any ideas?

What are you using these files for? If it's for perl scripts or the like,
you can usually alter the command used to run the script to have it cope
with windows encoding.

Changing from

#!/opt/bin/perl

to

#!/opt/bin/perl --

should do the trick iirc


HTH,
Kev

--
Kevin Campbell
e: kev@xxx.xxx.xxx
w: www.weegie.net
t: 0131 466 0583

-----------------------------------------------------------------------
You can find the EdLUG mailing list FAQ list at:
http://www.edlug.org.uk/list_faq.html



This archive is kept by wibble@morpheux.org.DONTSPAMME
homepage