you can use sed to whack dos style line ends
sed -i.old -e 's/^M//g' $files
                         ^^
the tricky part is that to make it happen you have to enter it as a
control character
in a commandline environment ctrl-v ctrl-$CHAR should do it,
in emacs it's ctrl-q ctrl-$CHAR (vi gurus?)

the one thing that sed does well is edit streams of text, it does not
do so well at guessing what you want, you have to tell it if you want
it to change line-endings etc.


On 5/5/05, Jason Van Cleve <[EMAIL PROTECTED]> wrote:
> Quoth Jason Van Cleve, on Wed, 4 May 2005 20:46:40 -0700:
> 
> >   sed -r -i s/[\ \      ]*$//g $files
> 
> Addendum:  I found some source files with DOS newlines in them, and this
> sed command doesn't work on those.  Evidently sed is stupid with regard
> to newlines, so now it's:
> 
>   dos2unix -k -q -o $files
>   sed -r -i s/[\ \      ]*$//g $files
> 
> Sure, sed is speedy, but does it do one thing well? . . .
> 
> --Jason
> 
> --
> I'd give my right arm to be ambidextrous!
> _______________________________________________
> EUGLUG mailing list
> [email protected]
> http://www.euglug.org/mailman/listinfo/euglug
> 


-- 
http://Zoneverte.org -- information explained
Do you know what your IT infrastructure does?
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug

Reply via email to