aboutsummaryrefslogtreecommitdiffstats
path: root/ed.1
blob: 22e8d7518f1ae1ee77e25ecaad694ce8a752d0dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
.\" To view this file, use `man -l ed.1`
.\" To view in other formats, look into mandoc(1) (recommended) or troff(1)
.
.\" Copyright (c) 2021 nytpu <alex@nytpu.com>
.\" SPDX-License-Identifier: GPL-3.0-only
.\" For more license details, see LICENSE or <https://www.gnu.org/licenses/gpl-3.0.html>.
.Dd June 4, 2021
.Dt ED 1
.Os
.
.Sh NAME
.Nm ed
.Nd line editor
.
.Sh SYNOPSIS
.Nm
.Op Fl h
.Op Fl l
.Op Fl p Ar string
.Op Fl s
.Op Fl v
.Op Fl V
.Op Ar file
.
.Sh DESCRIPTION
The
.Nm
utility is a line-based text editor.
It can be used create, display, modifiy, and otherwise manipulate text files
interactively or via a script.
.Pq
Note that this man page is used to note implementation details for this
specific implementation.
See
.Xr ed 1p
for a detailed description of available commands and an overview of usage.
.\" TODO
.
.Sh OPTIONS
.Bl -tag -width indent
.It Fl h
Display simplified usage information.
.It Fl l
Use a
.Dq loose exit status .
Even if a command has an error
.Pq a failed regex, for instance
exit successfully.
Useful when using
.Nm
as an editor for
.Xr git 1
or
.Xr cron 8 ,
where a failure exit status could discard all modifications, even if they were
valid.
.It Fl p Ar string
Use
.Ar string
as the prompt string when in command mode.
It can be toggled on and off with the
.Em P
command.
.It Fl s
Suppress diagnostics (if enabled), byte counts displayed when reading and
writing, and the
.Dq \&!
prompt.
Should be used if
.Nm Ns 's
standard input is from a script.
.It Fl v
Output verbose error messages.
Equivalent to the
.Em H
command.
.It Fl V
Display version and copyright information.
.It Ar file
Specify a filename to read into the buffer.
The default filename will be set to
.Ar file .
Essentially, it will act as if the
.Em e
command had been provided on the given
.Ar file
before accepting commands from stdin.
.El
.
.Sh LINE ADDRESSING
.\" TODO
.
.Sh REGULAR EXPRESSIONS
.\" TODO
.
.Sh COMMANDS
.\" TODO
.
.Sh DIAGNOSTICS
.\" TODO
.
.Sh FILES
.\" TODO
.
.Sh SEE ALSO
.Xr ed 1p
.Rs
.%A Michael W Lucas
.%B Ed Mastery: The Standard Unix Text Editor
.%D April 1, 2018
.%I Tilted Windmill Press
.Re
.
.Sh STANDARDS
This implementation of
.Nm
conforms to
.St -p1003.1-2008
in almost all cases where said standard is applicable.
However, the
.Fl l
flag
.Em is
in violation of the standard:
.Qo
Some historical implementations returned exit status zero even if command
errors had occurred; this is not allowed by this volume of POSIX.1-2008.
.Qc
.
.Sh AUTHORS
Documentation and software by
.An nytpu Aq Mt alex@nytpu.com
.Pp
.Nm
makes use of
.Xr linenoise 3 ,
by
Salvatore Sanfilippo
.Aq Mt antirez at gmail dot com
and Pieter Noordhuis
.Aq Mt pcnoordhuis at gmail dot com .
.
.Sh BUGS
The upstream URL of this project is
.Aq Lk https://git.nytpu.com/ed .
Send suggestions, bugs, and other contributions to
.Aq Mt alex@nytpu.com .
For help sending a patch through email, see
.Aq Lk https://git-send-email.io .
.
.Sh LIMITATIONS
This implementation of
.Nm
does not implement the
.Nm red
restricted editor.
It is the opinion of the author that the usefulness of
.Nm red
is obviated by modern security considerations and the fact that using
.Nm
as the default editor on a contemporary system is very unlikely.
The author recommends using a
.Xr chroot 1
jail if preventing a user from running commands or editing outside the current
directory is desired.
This would then allow the user to use their editor of choice, such as
.Xr vi 1
as well as
.Nm .