0

While transferring the project ear file from windows to unix, one of the jar file inside ear is modified, and all the files including files inside sub folders in the jar are added with (^M) characters. Need help in removing ^M characters from all the files inside the jar. Note: The jar file contains TTF files and many sub folders. the files in sub folders also need to corrected by removing ^M characters.

  • Any unix specialist can help me on this – Sivaram Chintalapudi May 08 '16 at 13:12
  • *"one of the jar file inside ear is modified"* Who is modifying it? Or did you mean that you *want* it to be modified? – Andreas May 08 '16 at 13:13
  • after transferring into unix environment, it getting added with ^M characters – Sivaram Chintalapudi May 08 '16 at 13:15
  • Are you sure they weren't there to begin with? That's the common way in Windows, you know. Newlines are done with `CR LF` in Windows, but only `LF` in Unix/Linux. I very much doubt that the transfer to Unix *added* them. – Andreas May 08 '16 at 13:26
  • yes you are right, but i need a solution to remove it in unix env – Sivaram Chintalapudi May 08 '16 at 13:31
  • The problem for me is, there are lot of files inside the jar. I cant manually remove each and every file. I need some script which can recursively search all folders inside jar and remove ^M characters inside each and every file – Sivaram Chintalapudi May 08 '16 at 13:34
  • 1
    Well, you tagged `dos2unix` so you should know there is a command for fixing one file. To fix all (or some) files inside a Jar file, unzip the Jar file to a temp folder, run the `dos2unix` program for each relevant file (using `find -exec`), and re-zip the Jar file. – Andreas May 08 '16 at 13:46
  • I am not familiar with unix script, it would be great if you provide any code snippet for this – Sivaram Chintalapudi May 08 '16 at 13:48

0 Answers0