ssh_file_delete_line_by_content
Delete one exact line from a remote file over SSH by matching its full content. Fails safely if the line is missing or not unique.
Instructions
Delete a line by its exact content. match_line must match EXACTLY ONE line in
the file (whitespace-trimmed, literal text - not a pattern); if it matches zero
lines or more than one, the operation fails with a descriptive error rather than
guessing which line(s) to delete. Use ssh_file_find_lines_with_pattern first if
you're not sure the line is unique. (Equivalent to
ssh_file_replace_line_multi(new_lines=[]), provided as a clearer-named shortcut.)
Returns:
On success: {'success': True} (no count field - only ever deletes the one
matched line). On failure (match not found, match not unique, file not
found/unreadable): {'success': False, 'error': str} - not a raised
exception.
Long-running calls: if this takes longer than the server's wait cap (default 50s), it
returns {"status": "in_progress", "handle_id": ...} instead of the result - the work keeps
running. Get the result by polling ssh_cmd_check_status(handle_id=...), which returns this
tool's normal response once finished. Do not call it again meanwhile. Only one such
operation runs at a time; another one started meanwhile fails with a 'busy' error.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | No longer needed (kept for compatibility): with use_sudo=true the file is read with sudo when the user can't read it. If it can't be read at all, the edit fails - it never reports success without having seen the file. | |
| use_sudo | No | Use sudo for the operation | |
| file_path | Yes | Path to the file to modify | |
| match_line | Yes | Exact line content to match and delete |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||