【发布时间】:2014-02-07 09:29:40
【问题描述】:
我想从find 中排除.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
【问题讨论】: