本文介绍了sed: 1: “...": 命令代码 f 无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

我查看了几个论坛,但没有发现有关代码 f 的任何信息.任何帮助/见解将不胜感激

I've looked at several forums and have found nothing about code f.Any help/insight would be appreciated

推荐答案

我发现出了什么问题.我需要在 -i 之后和 's/../../' 之前添加 '':

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'

这篇关于sed: 1: “...": 命令代码 f 无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 15:41