sed_edit
Modify files using sed patterns for single-line changes, replacements, and text edits. Create backups or preview changes before saving to ensure accuracy.
Instructions
Make small edits to files using sed patterns. Efficient for single-line changes, pattern replacements, and simple text transformations.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
backup | No | Create backup file before editing | |
file | Yes | Path to the file to edit | |
pattern | Yes | Sed pattern (e.g., "s/old/new/g" for substitution) | |
preview | No | Preview changes without modifying file |
Input Schema (JSON Schema)
{
"properties": {
"backup": {
"default": true,
"description": "Create backup file before editing",
"type": "boolean"
},
"file": {
"description": "Path to the file to edit",
"type": "string"
},
"pattern": {
"description": "Sed pattern (e.g., \"s/old/new/g\" for substitution)",
"type": "string"
},
"preview": {
"default": false,
"description": "Preview changes without modifying file",
"type": "boolean"
}
},
"required": [
"file",
"pattern"
],
"type": "object"
}