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:
 
 '-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.
 
 '-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. This 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.
 
 
    Exit status: 0 if no errors occurred; otherwise >0.