运行
grep -l \'texttofind\' * | xargs sed -i 's/toreplace/replacewith/g'
Im getting this error when I run the above command in the terminal.
sed: 1: "forkliftDailyChecklistW ...": invalid command code f
解决:
I figured out what was wrong. I needed to add '' after the -i and before the 's/../../':
grep -l \'texttofind\' * | xargs sed -i '' 's/toreplace/replacewith/g'
原文:http://stackoverflow.com/questions/29081799/sed-1-invalid-command-code-f
转自:sed 执行错误:sed: 1: “…”: Invalid command code f
本文介绍了一种在使用sed命令时出现的错误:sed: 1: '...' : invalid command code f,并提供了正确的命令格式来避免该错误。
2333

被折叠的 条评论
为什么被折叠?



