Linux sed (stream editor) part 3

continue from part 2 sed commands: y The 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 … Continue reading Linux sed (stream editor) part 3

Advertisements

Linux sed (stream editor) – part 2

Continuing from  part 1 of Linux Sed. If we want to run more than one sed's command on the text, we can use semicolons ';' or the -e . the structure is the following: sed -e '' -e '' Alternatively and more elegant is the semicolons  separator: sed '<command1>;<command2>;'  <fileName> Now let continue with the sed commands' list: … Continue reading Linux sed (stream editor) – part 2

Linux sed (stream editor) – part 1

Sed is a stream editor. We can use it to preform text transformation on input stream (regular file or input stream). The basic structure of sed is: sed <option> '<command>' <fileName> In this case it will change the file content according to the <command> and print it to the screen, the original file will be … Continue reading Linux sed (stream editor) – part 1