With the following script I'm trying to read a text file (italian.txt), and translate from this file all words from Italian into English and save the output in another text file (english.txt). I have to use sed command with the global command g so that I translate every appearance of the word.
It's not working correctly but I don't know what goes wrong. Can somebody help me?
cat italian.txt | sed -i 's/sole/sun/g' | 's/penna/pen/g' > english.txt exit 0
sedafter the second pipe:cat italian.txt | sed -i 's/sole/sun/g' | sed -i 's/penna/pen/g' > english.txtsedafter the second pipe?-iflag to indicate editing files "in place"; however, that requires a file, and you're instead usingstdin(thestdoutfromcat). You can remove the-i(from bothseds), and it should work fine.