Lingua Franca Project - Task 16


I am trying to complete the

Task 16
The name of our translation service is Lingua Franca , however some of the files mistakenly spell it as Lingua-Franca . Replace the string ‘Lingua-Franca’ with ‘Lingua Franca’ in all occurrences in all the .txt files.

Check your work using this command, confirming that there are 0 occurrences of Lingua-Franca across all text files:

grep -Rl ‘Lingua-Franca’ /.txt | wc -l


Use the sed command with the -i option. For example, to replace the typo “hellw” with “hello” in a text file called hello_world.txt , you would use the following command:

sed -i ‘s/hellw/hello/g’ hello_world.txt

When I typed the: sed -i ‘s/Lingua-Franca/Lingua Franca/g’ /.txt the terminal show me an error (see the photo)

What is the problem with my command line?

I’m assuming you’re on OSX? It’s likely using a different version of sed to the one the project expects (I think the OSX one is BSD based but has diverged from it to some degree too).

There’s a few similar questions linked at the following with some workarounds in the linked posts that other users have found successful:

Yes, I am using OSX. Thank you for the explanation. I will try it to see if I can complete that exercise.

1 Like

I’m also on Mac and I added .bik after the -I (read it somewhere online) and it worked

Final code looked like this:
sed -i.bak ‘s/Lingua-Franca/Lingua Franca/g’ /.txt

1 Like