Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.