http://www.cnblogs.com/dkblog/archive/2012/02/03/2337187.html
dos2unix file_name
sed -i 's/ $//' urfile