Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sed: 1: "...": Invalid command code f

Tags:

sed

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've looked at several forums and have found nothing about code f. Any help/insight would be appreciated

like image 372
Jonny Forney Avatar asked Mar 16 '15 16:03

Jonny Forney


1 Answers

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'
like image 101
Jonny Forney Avatar answered Oct 16 '22 13:10

Jonny Forney