First, find all files in current directory with the extension ".php" and remove all "^M" ^M = Ctrl+V + Ctrl+M (don't just type the caret "^" symbol and M...they are not the same :/ )
#!/bin/bash | |
#Find and replace all files with ^M (dos format) to Unix format. | |
find $(pwd) -type f -name "*.php" | while read file; do sed -e 's/^M//g' -i "$file"; done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment