sed

Installation
SKILL.md

GNU sed Skill

All output assumes GNU sed (sed --version shows GNU). POSIX compatibility is not a goal; use -E (extended regex) by default unless basic regex is clearly sufficient.


Core Principles

  1. Prefer one-liners. Multi-line sed scripts are a last resort.
  2. Use -E for extended regex (avoids backslash noise).
  3. Use -i for in-place edits; always show the command with a backup suffix suggestion (-i.bak) if the operation is destructive.
  4. Dry-run first. When editing files, show the sed without -i before the in-place version so the user can verify.
  5. Chain with pipes when sed alone isn't the cleanest tool.
  6. Never use sed to parse structured formats (JSON, YAML, XML). Redirect to jq, yq, or xmllint and say why.
Related skills
Installs
2
Repository
bastos/skills
GitHub Stars
2
First Seen
4 days ago