perl -i -pe 's/\cM*$//' foo bar baz [download]
In reply to Re: dos2unix problem by Fletch in thread dos2unix problem by Anonymous Monk