Sed, or Stream Editor as it is commonly known, is mainly used for parsing text and transforming any text within a script. This feature of Sed is used in Shell scripts to generate flexible and dynamic codes. Knowing the common tips and tricks can help users to optimize their codes to a great extent. One can do custom transformations of text such as substituting one text with another based on number of occurrence, displaying specific lines and removing spaces or blanks. One can also use tips and tricks for miscellaneous items such as joining multiple lines or replacing special characters from specific lines as well.
This document entitled « Sed - Tips and tricks » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.