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
toreplace
andreplacewith
). Wildly guessing: is there a/
in one of the terms? – Wintermute Mar 16 '15 at 16:24grep
is correct you should definitely check for/
in the arguments ofsed
. If this is the case, try using the syntax's_toreplace_replacewith_g'
. – TomCho Mar 16 '15 at 16:29