2016-07-10 10:59:29 +01:00
|
|
|
# ed
|
|
|
|
|
|
|
|
> The original Unix text editor.
|
2022-08-15 01:53:12 +01:00
|
|
|
> See also: `awk`, `sed`.
|
2022-03-09 04:28:57 +00:00
|
|
|
> More information: <https://www.gnu.org/software/ed/manual/ed_manual.html>.
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
- Start an interactive editor session with an empty document:
|
2016-07-10 10:59:29 +01:00
|
|
|
|
|
|
|
`ed`
|
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
- Start an interactive editor session with an empty document and a specific prompt:
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
`ed --prompt='> '`
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
- Start an interactive editor session with user-friendly errors:
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
`ed --verbose`
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
- Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt:
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
`ed --quiet`
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
- Start an interactive editor session without exit status change when command fails:
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
`ed --loose-exit-status`
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
- Edit a specific file (this shows the byte count of the loaded file):
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
`ed {{path/to/file}}`
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
- Replace a string with a specific replacement for all lines:
|
2016-07-10 10:59:29 +01:00
|
|
|
|
2022-08-15 01:53:12 +01:00
|
|
|
`,s/{{regular_expression}}/{{replacement}}/g`
|