We develop a file in windows and move to unix box as a part of deployment. When we do this, we get ctrl-M(^M) character added to the file. So we need to remove ctrl-M(^M) character from all the files from deployment folder and all subfolders folder. Currently we move to individual folders and subfolders and run dos2unix command to remove the ^M character. Can you please help us create a script which replaces all the ^M character by running this script.
I am looking for kind of loop which traverse all the subfolders and remove ^M if found.
I have tried this option. Seem good for those file which does contain only text content. For xml files which has special characters like "" are replaced by \357\273\277 character. This is know issue with dos2unix command and this lead to compilation error of XML parser. Can we have better filter which replaces only ^M character with the your command?
Also I need to know how to search and find out files which contain ^M in the list of files from the root to all the subdirectories. The output of the command should be path and file name of the file which contains ^M character.
I will check your 'tr' command and reply. Can you please give me some quick reply to find out list of files which contains ^M Character? I use following command but not working as expected.