Search posts

Linux sed (stream editor) part 3

yThe y command is doing substitution of letter by letter. We give it a series of letters to replace, and then in the same order a series of letters that replacing the first series. It will replace the first letter from the first series with the first letter from the second series, the second letter from the first series with the second letter from the second series and so.
In the example below, we print the content of the bower.json file and then use the y to replace a with e

r – read file
The r command will read the content of the file to the current location of the sed execution. The structure isr <fileName>
In the example below we read the content of the test file in the end of the file bower.json