aboutsummaryrefslogblamecommitdiffstats
path: root/ed.1
blob: 22e8d7518f1ae1ee77e25ecaad694ce8a752d0dc (plain) (tree)
1
2
3
4
5
6
7





                                                                                         
                









               
        











                                                                            





                                                                          





                                     













                                                                              





























































                                                                         









                                                                         



                              








                                     



























                                                                              
.\" 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 .