Tagged articles
2 articles
Page 1 of 1
MaGe Linux Operations
MaGe Linux Operations
Apr 7, 2024 · Fundamentals

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.

Shellquotingregex
0 likes · 15 min read
Mastering sed: Variable Substitution, Quoting, and Advanced Tricks