Mastering sed: Variable Substitution, Quoting, and Advanced Tricks
This article explains how to correctly use shell variables and variable substitution in sed, clarifies quoting rules, demonstrates retrieving the last N lines, handling backreferences, the -i option, greedy matching, the interplay of a and N commands, exclamation negation, and troubleshooting high CPU usage.
