2
我想從find
排除.git
文件夾,因爲sed
總是破壞git
索引文件。我的腳本是:查找 - 文件夾不排除和sed腐敗git索引,因爲它
folder_root="my-files/files"
# change text in files
find $folder_root/ -type f -and -not -path $folder_root/.git -print0 | LC_ALL=en_US.CP437 xargs -0 -n 1 sed -i '' -e 's/fromthis/tothis/g'
,仍然git index
得到腐敗:只有
error: bad index file sha1 signature
fatal: index file corrupt