Every file in this Rails project is duplicated with a -e
and again with a -e-e
tacked onto the end of it, like the following. It's that way in my GitHub repository too. But I can't figure out how it happened. Any clue? Google searching comes up empty.
-rw-r--r--@ 1 usrname staff 959 Jan 7 02:13 Gemfile -rw-r--r-- 1 usrname staff 958 Jan 5 01:10 Gemfile-e -rw-r--r-- 1 usrname staff 958 Jan 5 01:09 Gemfile-e-e -rw-r--r-- 1 usrname staff 6650 Jan 7 02:13 Gemfile.lock -rw-r--r-- 1 usrname staff 6650 Jan 5 01:10 Gemfile.lock-e -rw-r--r-- 1 usrname staff 6650 Jan 5 01:09 Gemfile.lock-e-e lrwxr-xr-x 1 usrname staff 18 Jan 5 00:37 README.rdoc -> doc/README_FOR_APP -rw-r--r-- 1 usrname staff 283 Jan 5 01:10 Rakefile -rw-r--r-- 1 usrname staff 283 Jan 5 01:10 Rakefile-e -rw-r--r-- 1 usrname staff 283 Jan 5 01:09 Rakefile-e-e drwxr-xr-x 6 usrname开发者_JS百科 staff 204 Jan 5 00:37 app drwxr-xr-x 5 usrname staff 170 Jan 5 01:10 autotest drwxr-xr-x 28 usrname staff 952 Jan 5 01:15 config -rw-r--r-- 1 usrname staff 173 Jan 5 01:10 config.ru -rw-r--r-- 1 usrname staff 173 Jan 5 01:10 config.ru-e -rw-r--r-- 1 usrname staff 173 Jan 5 01:09 config.ru-e-e
The Explanation in Full
The recursive find and replace command
find ./ -type f -exec sed -i 's/string1/string2/' {} \;
works on most linux, but throws an error on mac os x. The following variant runs, but creates the unwanted '-e' backup files.
find ./ -type f -exec sed -i -e 's/string1/string2/' {} \;
This is the actual command that works as expected on mac os x:
find ./ -type f -exec sed -i "" 's/string1/string2/' {} \;
Git does not do this, nor does Ruby or Rails. There's some script you've ran that has done this. Think back, what did you do before you noticed this?
精彩评论