how to remove it?

http://its.ucsc.edu/unix-timeshare/tutorials/clean-ctrl-m.html

how to input character ^M?

https://ustcchenjian.wordpress.com/2009/01/31/shell-grep%E5%90%8E%E7%9A%84%E5%8F%82%E6%95%B0/

what is the hex code of ^M?

refer this page http://www.kevssite.com/2009/04/21/using-vi-as-a-hex-editor/ to use vi to view ^M hex code. It is 0d

 

Advertisements