sed
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
- Prefer one-liners. Multi-line sed scripts are a last resort.
- Use
-Efor extended regex (avoids backslash noise). - Use
-ifor in-place edits; always show the command with a backup suffix suggestion (-i.bak) if the operation is destructive. - Dry-run first. When editing files, show the
sedwithout-ibefore the in-place version so the user can verify. - Chain with pipes when sed alone isn't the cleanest tool.
- Never use sed to parse structured formats (JSON, YAML, XML). Redirect to
jq,yq, orxmllintand say why.
More from bastos/skills
proxmox-admin
Administers Proxmox VE hosts, creates and manages VMs with qm, manages LXC containers with pct, configures storage, networking, clusters, and automates provisioning tasks via the Proxmox CLI.
303obsidian-daily
Manages Obsidian Daily Notes via the official Obsidian CLI. Creates and opens daily notes, appends entries (journals, logs, tasks, links), reads daily notes and vault files, searches vault content, and handles relative dates like "yesterday", "last Friday", and "3 days ago". Requires Obsidian 1.12+ with Command line interface enabled.
50conventional-commits
Formats commit messages using the Conventional Commits specification. Use when creating commits, writing commit messages, or when the user mentions commits, git commits, or commit messages. Ensures commits follow the standard format for automated tooling, changelog generation, and semantic versioning.
21tmuxinator
Helps create, edit, and debug tmuxinator project configurations, set up complex tmux session layouts, and automate development environment startup with multiple windows and panes.
15topydo
Manages todo.txt tasks using topydo CLI. Adds, lists, completes, prioritizes, tags, and organizes tasks with dependencies, due dates, recurrence, and projects. Use for any task management, todo lists, or when the user mentions tasks, todos, or todo.txt. Requires Python 3 and pip. Works on macOS, Linux, and Windows.
14swift-review
>
5