简体   繁体   中英

How to remove all `^M` characters from an iOS project in Mac copied from Windows?

I had to clone an iOS project from github in my Windows . Then when I copied that project into my Mac using a pen drive, the project is no more buildable and many files showing ^M characters in lines end due to difference of End of Line Character formats in different platform.

So what is the proper way to make this project buildable on my Mac?

You can use dos2unix :

$ brew install dos2unix
$ dos2unix *.swift

Without dos2unix :

for file in *.swift; do tr -d '\r' < $file > temp && mv temp $file; done

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM