ed: Invoking ed
3 Invoking ed
*************
The format for running 'ed' is:
ed [OPTIONS] [FILE]
red [OPTIONS] [FILE]
FILE specifies the name of a file to read. If FILE is prefixed with a
bang (!), then it is interpreted as a shell command. In this case, what is
read is the standard output of FILE executed via 'sh (1)'. To read a file
whose name begins with a bang, prefix the name with a backslash ('\'). The
default filename is set to FILE only if it is not prefixed with a bang.
'ed' supports the following options: ⇒Argument syntax
(arg_parser)Argument syntax.
'-h'
'--help'
Print an informative help message describing the options and exit.
'-V'
'--version'
Print the version number of 'ed' on the standard output and exit. This
version number should be included in all bug reports.
'-E'
'--extended-regexp'
Use extended regular expressions instead of the basic regular
expressions mandated by POSIX.
'-G'
'--traditional'
Forces backwards compatibility. This affects the behavior of the 'ed'
commands 'G', 'V', 'f', 'l', 'm', 't' and '!!'. If the default
behavior of these commands does not seem familiar, then try invoking
'ed' with this switch.
'-l'
'--loose-exit-status'
Don't exit with bad status if a command happens to "fail" (for example
if a substitution command finds nothing to replace). This can be useful
when 'ed' is invoked as the editor for crontab.
'-p STRING'
'--prompt=STRING'
Specifies a command prompt string and turns prompting on. Showing the
prompt string may be toggled on and off with the 'P' command.
'-r'
'--restricted'
Run in restricted mode. This mode disables editing of files out of the
current directory and execution of shell commands.
'-s'
'--quiet'
'--silent'
Suppresses diagnostics, the printing of byte counts by 'e', 'E', 'r'
and 'w' commands, and the '!' prompt after a '!' command. This option
may be useful if 'ed''s standard input is from a script.
'-v'
'--verbose'
Verbose mode; prints error explanations. This may be toggled on and off
with the 'H' command.
'--strip-trailing-cr'
Strip the carriage returns at the end of text lines in DOS files. CRs
are removed only from the CR/LF (carriage return/line feed) pair
ending the line. CRs at other positions in the line, including a CR
finishing an unterminated line, are not removed. The CRs are not
restored when saving the buffer to a file.
Exit status: 0 if no errors occurred; otherwise >0.