{
    "mode": "info",
    "parameter": "ed",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/ed/json",
    "generated": "2026-06-08T15:59:05Z",
    "sections": {
        "The GNU ed line editor": {
            "content": "This manual is for GNU ed (version 1.18, 4 February 2022).\n\n* Menu:\n\n* Overview::                        Overview of the 'ed' command\n* Introduction to line editing::    Getting started with GNU 'ed'\n* Invoking ed::                     Command line interface\n* Line addressing::                 Specifying lines/ranges in the buffer\n* Regular expressions::             Patterns for selecting text\n* Commands::                        Commands recognized by GNU 'ed'\n* The 's' Command::                 Substitute command\n* Limitations::                     Intrinsic limits of GNU 'ed'\n* Diagnostics::                     GNU 'ed' error handling\n* Problems::                        Reporting bugs\n* GNU Free Documentation License::  How you can copy and share this manual\n\n\nCopyright (C) 1993, 1994, 2006-2022 Free Software Foundation, Inc.\n\nPermission is granted to copy, distribute and/or modify this document\nunder the terms of the GNU Free Documentation License, Version 1.3 or any\nlater version published by the Free Software Foundation; with no Invariant\nSections, no Front-Cover Texts, and no Back-Cover Texts.\n\nFile: ed.info,  Node: Overview,  Next: Introduction to line editing,  Prev: Top,  Up: Top\n",
            "subsections": []
        },
        "1 Overview": {
            "content": "GNU ed is a line-oriented text editor. It is used to create, display, modify\nand otherwise manipulate text files, both interactively and via shell\nscripts. A restricted version of ed, red, can only edit files in the current\ndirectory and cannot execute shell commands. Ed is the 'standard' text\neditor in the sense that it is the original editor for Unix, and thus widely\navailable. For most purposes, however, it is superseded by full-screen\neditors such as GNU Emacs or GNU Moe.\n\nGNU ed is based on the editor algorithm described in Brian W. Kernighan\nand P. J. Plauger's book \"Software Tools in Pascal\", Addison-Wesley, 1981.\n\nIf invoked with a FILE argument, then a copy of FILE is read into the\neditor's buffer. Changes are made to this copy and not directly to FILE\nitself. Upon quitting 'ed', any changes not explicitly saved with a 'w'\ncommand are lost. In interactive mode, a non-existing FILE is reported but\ndoes not alter the exit status.\n\nEditing is done in two distinct modes: \"command\" and \"input\". When first\ninvoked, 'ed' is in command mode. In this mode commands are read from the\nstandard input and executed to manipulate the contents of the editor\nbuffer. A typical command might look like:\n\n,s/OLD/NEW/g\n\nwhich replaces all occurences of the string OLD with NEW.\n\nWhen an input command, such as 'a' (append), 'i' (insert) or 'c'\n(change), is given, 'ed' enters input mode. This is the primary means of\nadding text to a file. In this mode, no commands are available; instead,\nthe standard input is written directly to the editor buffer. A \"line\"\nconsists of the text up to and including a <newline> character. Input mode\nis terminated by entering a single period ('.') on a line.\n\nAll 'ed' commands operate on whole lines or ranges of lines; e.g., the\n'd' command deletes lines; the 'm' command moves lines, and so on. It is\npossible to modify only a portion of a line by means of replacement, as in\nthe example above. However even here, the 's' command is applied to whole\nlines at a time.\n\nIn general, 'ed' commands consist of zero or more line addresses,\nfollowed by a single character command and possibly additional parameters;\ni.e., commands have the structure:\n\n[ADDRESS[,ADDRESS]]COMMAND[PARAMETERS]\n\nThe ADDRESSes indicate the line or range of lines to be affected by the\ncommand. If fewer addresses are given than the command accepts, then\ndefault addresses are supplied.\n\nFile: ed.info,  Node: Introduction to line editing,  Next: Invoking ed,  Prev: Overview,  Up: Top\n",
            "subsections": []
        },
        "2 Introduction to line editing": {
            "content": "'ed' was created, along with the Unix operating system, by Ken Thompson and\nDennis Ritchie. It is the refinement of its more complex, programmable\npredecessor, 'QED', to which Thompson and Ritchie had already added pattern\nmatching capabilities (*note Regular expressions::).\n\nFor the purposes of this tutorial, a working knowledge of the Unix shell\n'sh' and the Unix file system is recommended, since 'ed' is designed to\ninteract closely with them. (*Note GNU bash manual: (bash)Top, for details\nabout bash).\n\nThe principal difference between line editors and display editors is\nthat display editors provide instant feedback to user commands, whereas\nline editors require sometimes lengthy input before any effects are seen.\nThe advantage of instant feedback, of course, is that if a mistake is made,\nit can be corrected immediately, before more damage is done. Editing in\n'ed' requires more strategy and forethought; but if you are up to the task,\nit can be quite efficient.\n\nMuch of the 'ed' command syntax is shared with other Unix utilities.\n\nAs with the shell, <RETURN> (the carriage-return key) enters a line of\ninput. So when we speak of \"entering\" a command or some text in 'ed',\n<RETURN> is implied at the end of each line. Prior to typing <RETURN>,\ncorrections to the line may be made by typing either <BACKSPACE> to erase\ncharacters backwards, or <CONTROL>-u (i.e., hold the CONTROL key and type\nu) to erase the whole line.\n\nWhen 'ed' first opens, it expects to be told what to do but doesn't\nprompt us like the shell. So let's begin by telling 'ed' to do so with the\n<P> (\"prompt\") command:\n\n$ ed\nP\n*\n\nBy default, 'ed' uses asterisk ('*') as command prompt to avoid\nconfusion with the shell command prompt ('$').\n\nWe can run Unix shell ('sh') commands from inside 'ed' by prefixing them\nwith <!> (exclamation mark, aka \"bang\"). For example:\n\n*!date\nMon Jun 26 10:08:41 PDT 2006\n!\n*!for s in hello world; do echo $s; done\nhello\nworld\n!\n*\n\nSo far, this is no different from running commands in the Unix shell.\nBut let's say we want to edit the output of a command, or save it to a\nfile. First we must capture the command output to a temporary location\ncalled a \"buffer\" where 'ed' can access it. This is done with 'ed''s <r>\ncommand (mnemonic: \"read\"):\n\n*r !cal -m\n137\n*\n\nHere 'ed' is telling us that it has just read 137 characters into the\neditor buffer - i.e., the output of the 'cal' command, which prints a\nsimple ASCII calendar. To display the buffer contents we issue the <p>\n(\"print\") command (not to be confused with the prompt command, which is\nuppercase!). To indicate the range of lines in the buffer that should be\nprinted, we prefix the command with <,> (comma) which is shorthand for \"the\nwhole buffer\":\n\n*,p\nJune 2006\nMo Tu We Th Fr Sa Su\n1  2  3  4\n5  6  7  8  9 10 11\n12 13 14 15 16 17 18\n19 20 21 22 23 24 25\n26 27 28 29 30\n\n*\n\nNow let's write the buffer contents to a file named 'junk' with the <w>\n(\"write\") command:\n\n*w junk\n137\n*\n\nNeed we say? It's good practice to frequently write the buffer contents,\nsince unwritten changes to the buffer will be lost when we exit 'ed'.\n\nThe sample sessions below illustrate some basic concepts of line editing\nwith 'ed'. We begin by creating a file, 'sonnet', with some help from\nShakespeare. As with the shell, all input to 'ed' must be followed by a\n<newline> character. Commands beginning with '#' are taken as comments and\nignored. Input mode lines that begin with '#' are just more input.\n\n$ ed\n# The 'a' command is for appending text to the editor buffer.\na\nNo more be grieved at that which thou hast done.\nRoses have thorns, and filvers foutians mud.\nClouds and eclipses stain both moon and sun,\nAnd loathsome canker lives in sweetest bud.\n.\n# Entering a single period on a line returns 'ed' to command mode.\n# Now write the buffer to the file 'sonnet' and quit:\nw sonnet\n183\n# 'ed' reports the number of characters written.\nq\n$ ls -l\ntotal 2\n-rw-rw-r--    1 alm           183 Nov 10 01:16 sonnet\n$\n\nIn the next example, some typos are corrected in the file 'sonnet'.\n\n$ ed sonnet\n183\n# Begin by printing the buffer to the terminal with the 'p' command.\n# The ',' means \"all lines\".\n,p\nNo more be grieved at that which thou hast done.\nRoses have thorns, and filvers foutians mud.\nClouds and eclipses stain both moon and sun,\nAnd loathsome canker lives in sweetest bud.\n# Select line 2 for editing.\n2\nRoses have thorns, and filvers foutians mud.\n# Use the substitute command, 's', to replace 'filvers' with 'silver',\n# and print the result.\ns/filvers/silver/p\nRoses have thorns, and silver foutians mud.\n# And correct the spelling of 'fountains'.\ns/utia/untai/p\nRoses have thorns, and silver fountains mud.\nw sonnet\n183\nq\n$\n\nSince 'ed' is line-oriented, we have to tell it which line, or range of\nlines we want to edit. In the example above, we do this by specifying the\nline's number, or sequence in the buffer. Alternatively, we could have\nspecified a unique string in the line, e.g., '/filvers/', where the '/'s\ndelimit the string in question. Subsequent commands affect only the\nselected line, a.k.a. the \"current\" line. Portions of that line are then\nreplaced with the substitute command, whose syntax is 's/OLD/NEW/'.\n\nAlthough 'ed' accepts only one command per line, the print command 'p'\nis an exception, and may be appended to the end of most commands.\n\nIn the next example, a title is added to our sonnet.\n\n$ ed sonnet\n183\na\nSonnet #50\n.\n,p\nNo more be grieved at that which thou hast done.\nRoses have thorns, and silver fountains mud.\nClouds and eclipses stain both moon and sun,\nAnd loathsome canker lives in sweetest bud.\nSonnet #50\n# The title got appended to the end; we should have used '0a'\n# to append \"before the first line\".\n# Move the title to its proper place.\n5m0p\nSonnet #50\n# The title is now the first line, and the current address has been\n# set to the address of this line as well.\n,p\nSonnet #50\nNo more be grieved at that which thou hast done.\nRoses have thorns, and silver fountains mud.\nClouds and eclipses stain both moon and sun,\nAnd loathsome canker lives in sweetest bud.\nwq sonnet\n195\n$\n\nWhen 'ed' opens a file, the current address is initially set to the\naddress of the last line of that file. Similarly, the move command 'm' sets\nthe current address to the address of the last line moved.\n\nRelated programs or routines are 'vi (1)', 'sed (1)', 'regex (3)', 'sh\n(1)'. Relevant documents are:\n\nUnix User's Manual Supplementary Documents: 12 -- 13\n\nB. W. Kernighan and P. J. Plauger: \"Software Tools in Pascal\",\nAddison-Wesley, 1981.\n\nFile: ed.info,  Node: Invoking ed,  Next: Line addressing,  Prev: Introduction to line editing,  Up: Top\n",
            "subsections": []
        },
        "3 Invoking ed": {
            "content": "The format for running 'ed' is:\n\ned [OPTIONS] [FILE]\nred [OPTIONS] [FILE]\n\nFILE specifies the name of a file to read. If FILE is prefixed with a\nbang (!), then it is interpreted as a shell command. In this case, what is\nread is the standard output of FILE executed via 'sh (1)'. To read a file\nwhose name begins with a bang, prefix the name with a backslash ('\\'). The\ndefault filename is set to FILE only if it is not prefixed with a bang.\n\n'ed' supports the following options: *Note Argument syntax:\n(argparser)Argument syntax.\n\n'-h'\n'--help'\nPrint an informative help message describing the options and exit.\n\n'-V'\n'--version'\nPrint the version number of 'ed' on the standard output and exit. This\nversion number should be included in all bug reports.\n\n'-E'\n'--extended-regexp'\nUse extended regular expressions instead of the basic regular\nexpressions mandated by POSIX.\n\n'-G'\n'--traditional'\nForces backwards compatibility. This affects the behavior of the 'ed'\ncommands 'G', 'V', 'f', 'l', 'm', 't' and '!!'. If the default\nbehavior of these commands does not seem familiar, then try invoking\n'ed' with this switch.\n\n'-l'\n'--loose-exit-status'\nDon't exit with bad status if a command happens to \"fail\" (for example\nif a substitution command finds nothing to replace). This can be useful\nwhen 'ed' is invoked as the editor for crontab.\n\n'-p STRING'\n'--prompt=STRING'\nSpecifies a command prompt string and turns prompting on. Showing the\nprompt string may be toggled on and off with the 'P' command.\n\n'-r'\n'--restricted'\nRun in restricted mode. This mode disables editing of files out of the\ncurrent directory and execution of shell commands.\n\n'-s'\n'--quiet'\n'--silent'\nSuppresses diagnostics, the printing of byte counts by 'e', 'E', 'r'\nand 'w' commands, and the '!' prompt after a '!' command. This option\nmay be useful if 'ed''s standard input is from a script.\n\n'-v'\n'--verbose'\nVerbose mode; prints error explanations. This may be toggled on and off\nwith the 'H' command.\n\n'--strip-trailing-cr'\nStrip the carriage returns at the end of text lines in DOS files. CRs\nare removed only from the CR/LF (carriage return/line feed) pair\nending the line. CRs at other positions in the line, including a CR\nfinishing an unterminated line, are not removed. The CRs are not\nrestored when saving the buffer to a file.\n\n\nExit status: 0 if no errors occurred; otherwise >0.\n\nFile: ed.info,  Node: Line addressing,  Next: Regular expressions,  Prev: Invoking ed,  Up: Top\n",
            "subsections": []
        },
        "4 Line addressing": {
            "content": "An address represents the number of a line in the buffer. 'ed' maintains a\n\"current address\" which is typically supplied to commands as the default\naddress when none is specified. When a file is first read, the current\naddress is set to the address of the last line of the file. In general, the\ncurrent address is set to the address of the last line affected by a\ncommand.\n\nOne exception to the rule that addresses represent line numbers is the\naddress '0' (zero). This means \"at the beginning of the buffer\", and is\nvalid wherever it makes sense.\n\nAn address range is two addresses separated either by a comma (',') or a\nsemicolon (';'). In a semicolon-delimited range, the current address ('.')\nis set to the first address before the second address is calculated. This\nfeature can be used to set the starting line for searches if the second\naddress contains a regular expression. The value of the first address in a\nrange cannot exceed the value of the second.\n\nAddresses can be omitted on either side of the comma or semicolon\nseparator. If only the first address is given in a range, then the second\naddress is set to the given address. If only the second address is given,\nthe resulting address pairs are '1,addr' and '.;addr' respectively. If a\nN-tuple of addresses is given where N > 2, then the corresponding range is\ndetermined by the last two addresses in the N-tuple. If only one address is\nexpected, then the last address is used. It is an error to give any number\nof addresses to a command that requires zero addresses.\n\nA line address is constructed as follows:\n\n'.'\nThe current line (address) in the buffer.\n\n'$'\nThe last line in the buffer.\n\n'N'\nThe Nth line in the buffer, where N is a number in the range '0,$'.\n\n'+N'\nThe Nth next line, where N is a non-negative number.\n\n'-N'\nThe Nth previous line, where N is a non-negative number.\n\n'+'\nThe next line. This is equivalent to '+1' and may be repeated with\ncumulative effect.\n\n'-'\nThe previous line. This is equivalent to '-1' and may be repeated with\ncumulative effect.\n\n','\nThe first through last lines in the buffer. This is equivalent to the\naddress range '1,$'.\n\n';'\nThe current through last lines in the buffer. This is equivalent to the\naddress range '.;$'.\n\n'/RE/[I]'\nThe next line containing the regular expression RE. The search wraps\nto the beginning of the buffer and continues down to the current line,\nif necessary. The suffix 'I' is a GNU extension which makes 'ed' match\nRE in a case-insensitive manner.\n\n'?RE?[I]'\nThe previous line containing the regular expression RE. The search\nwraps to the end of the buffer and continues up to the current line, if\nnecessary. The suffix 'I' is a GNU extension which makes 'ed' match RE\nin a case-insensitive manner.\n\n''x'\nThe apostrophe-x character pair addresses the line previously marked by\na 'k' (mark) command, where 'x' is a lower case letter from the\nportable character set '[a-z]'.\n\n\nAddresses can be followed by one or more address offsets, optionally\nseparated by whitespace. Offsets are constructed as follows:\n\n* '+' or '-' followed by a number adds or subtracts the indicated number\nof lines to or from the address.\n\n* '+' or '-' not followed by a number adds or subtracts 1 to or from the\naddress.\n\n* A number adds the indicated number of lines to the address.\n\n\nIt is not an error if an intermediate address value is negative or\ngreater than the address of the last line in the buffer. It is an error if\nthe final address value is negative or greater than the address of the last\nline in the buffer. It is an error if a search for a regular expression\nfails to find a matching line.\n\nFile: ed.info,  Node: Regular expressions,  Next: Commands,  Prev: Line addressing,  Up: Top\n",
            "subsections": []
        },
        "5 Regular expressions": {
            "content": "Regular expressions are patterns used in selecting text. For example, the\n'ed' command\n\ng/STRING/\n\nprints all lines containing STRING. Regular expressions are also used by\nthe 's' command for selecting old text to be replaced with new text.\n\nIn addition to specifying string literals, regular expressions can\nrepresent classes of strings. Strings thus represented are said to be\nmatched by the corresponding regular expression. If it is possible for a\nregular expression to match several strings in a line, then the left-most\nmatch is the one selected. If the regular expression permits a variable\nnumber of matching characters, the longest sequence starting at that point\nis matched.\n\nAn empty regular expression is equivalent to the last regular expression\nprocessed. Therefore '/RE/s//REPLACEMENT/' replaces RE with REPLACEMENT.\n\nAs a GNU extension, a regular expression /RE/ may be followed by the\nsuffix 'I' which makes 'ed' match RE in a case-insensitive manner. Note\nthat the suffix is evaluated when the regular expression is compiled, thus\nit is invalid to specify it together with the empty regular expression.\n\nThe following symbols are used in constructing regular expressions using\nPOSIX basic regular expression syntax:\n\n'C'\nAny character C not listed below, including '{', '}', '(', ')', '<'\nand '>', matches itself.\n\n'\\C'\nAny backslash-escaped character C, other than '{', '}', '(', ')', '<',\n'>', 'b', 'B', 'w', 'W', '+' and '?', matches itself.\n\n'.'\nMatches any single character.\n\n'[CHAR-CLASS]'\nMatches any single character in CHAR-CLASS. To include a ']' in\nCHAR-CLASS, it must be the first character. A range of characters may\nbe specified by separating the end characters of the range with a '-',\ne.g., 'a-z' specifies the lower case characters. The following literal\nexpressions can also be used in CHAR-CLASS to specify sets of\ncharacters:\n\n[:alnum:] [:cntrl:] [:lower:] [:space:]\n[:alpha:] [:digit:] [:print:] [:upper:]\n[:blank:] [:graph:] [:punct:] [:xdigit:]\n\nIf '-' appears as the first or last character of CHAR-CLASS, then it\nmatches itself. All other characters in CHAR-CLASS match themselves.\n\nPatterns in CHAR-CLASS of the form:\n[.COL-ELM.]\n[=COL-ELM=]\n\nwhere COL-ELM is a \"collating element\" are interpreted according to\n'locale (5)'. See 'regex (7)' for an explanation of these constructs.\n\n'[^CHAR-CLASS]'\nMatches any single character, other than newline, not in CHAR-CLASS.\nCHAR-CLASS is defined as above.\n\n'^'\nIf '^' is the first character of a regular expression, then it anchors\nthe regular expression to the beginning of a line. Otherwise, it\nmatches itself.\n\n'$'\nIf '$' is the last character of a regular expression, it anchors the\nregular expression to the end of a line. Otherwise, it matches itself.\n\n'\\(RE\\)'\nDefines a (possibly empty) subexpression RE. Subexpressions may be\nnested. A subsequent backreference of the form '\\N', where N is a\nnumber in the range [1,9], expands to the text matched by the Nth\nsubexpression. For example, the regular expression '\\(a.c\\)\\1' matches\nthe string 'abcabc', but not 'abcadc'. Subexpressions are ordered\nrelative to their left delimiter.\n\n'*'\nMatches zero or more repetitions of the regular expression immediately\npreceding it. The regular expression can be either a single character\nregular expression or a subexpression. If '*' is the first character\nof a regular expression or subexpression, then it matches itself. The\n'*' operator sometimes yields unexpected results. For example, the\nregular expression 'b*' matches the beginning of the string 'abbb', as\nopposed to the substring 'bbb', since an empty string is the only\nleft-most match.\n\n'\\{N,M\\}'\n'\\{N,\\}'\n'\\{N\\}'\nMatches the single character regular expression or subexpression\nimmediately preceding it at least N and at most M times. If M is\nomitted, then it matches at least N times. If the comma is also\nomitted, then it matches exactly N times. If any of these forms occurs\nfirst in a regular expression or subexpression, then it is interpreted\nliterally (i.e., the regular expression '\\{2\\}' matches the string\n'{2}', and so on).\n\n\nThe following extensions to basic regular expression operators are\npreceded by a backslash '\\' to distinguish them from traditional 'ed'\nsyntax. They may be unavailable depending on the particular regex\nimplementation in your system.\n\n'\\<'\n'\\>'\nAnchors the single character regular expression or subexpression\nimmediately following it to the beginning (in the case of '\\<') or\nending (in the case of '\\>') of a \"word\", i.e., in ASCII, a maximal\nstring of alphanumeric characters, including the underscore ().\n\n'\\`'\n'\\''\nUnconditionally matches the beginning '\\`' or ending '\\'' of a line.\n\n'\\?'\nOptionally matches the single character regular expression or\nsubexpression immediately preceding it. For example, the regular\nexpression 'a[bd]\\?c' matches the strings 'abc', 'adc' and 'ac'. If\n'\\?' occurs at the beginning of a regular expressions or\nsubexpression, then it matches a literal '?'.\n\n'\\+'\nMatches the single character regular expression or subexpression\nimmediately preceding it one or more times. So the regular expression\n'a\\+' is shorthand for 'aa*'. If '\\+' occurs at the beginning of a\nregular expression or subexpression, then it matches a literal '+'.\n\n'\\b'\nMatches the beginning or ending (empty string) of a word. Thus the\nregular expression '\\bhello\\b' is equivalent to '\\<hello\\>'. However,\n'\\b\\b' is a valid regular expression whereas '\\<\\>' is not.\n\n'\\B'\nMatches (an empty string) inside a word.\n\n'\\w'\nMatches any word-constituent character (letters, digits, and the\nunderscore).\n\n'\\W'\nMatches any character that is not a word-constituent.\n\n\nFile: ed.info,  Node: Commands,  Next: The 's' Command,  Prev: Regular expressions,  Up: Top\n",
            "subsections": []
        },
        "6 Commands": {
            "content": "All 'ed' commands are single characters, though some require additional\nparameters. If a command's parameters extend over several lines, then each\nline except for the last must be terminated with a backslash ('\\').\n\nIn general, at most one command is allowed per line. However, most\ncommands accept a print suffix, which is any of 'p' (print), 'l' (list), or\n'n' (enumerate), to print the last line affected by the command. It is not\nportable to give more than one print suffix, but 'ed' allows any\ncombination of non-repeated print suffixes and combines their effects. If\nany suffix letter is given, it must immediately follow the command.\n\nThe 'e', 'E', 'f', 'r', and 'w' commands take an optional FILE\nparameter, separated from the command letter by one or more whitespace\ncharacters.\n\nAn interrupt (typically <Control-C>) has the effect of aborting the\ncurrent command and returning the editor to command mode.\n\n'ed' recognizes the following commands. The commands are shown together\nwith the default address or address range supplied if none is specified (in\nparenthesis).\n\n'(.)a'\nAppends text to the buffer after the addressed line. The address '0'\n(zero) is valid for this command; it places the entered text at the\nbeginning of the buffer. Text is entered in input mode. The current\naddress is set to the address of the last line entered or, if there\nwere none, to the addressed line.\n\n'(.,.)c'\nChanges lines in the buffer. The addressed lines are deleted from the\nbuffer, and text is inserted in their place. Text is entered in input\nmode. The current address is set to the address of the last line\nentered or, if there were none, to the new address of the line after\nthe last line deleted; if the lines deleted were originally at the end\nof the buffer, the current address is set to the address of the new\nlast line; if no lines remain in the buffer, the current address is\nset to zero. The lines deleted are copied to the cut buffer.\n\n'(.,.)d'\nDeletes the addressed lines from the buffer. The current address is\nset to the new address of the line after the last line deleted; if the\nlines deleted were originally at the end of the buffer, the current\naddress is set to the address of the new last line; if no lines remain\nin the buffer, the current address is set to zero. The lines deleted\nare copied to the cut buffer.\n\n'e FILE'\nEdits FILE, and sets the default filename. If FILE is not specified,\nthen the default filename is used. Any lines in the buffer are deleted\nbefore the new file is read. The current address is set to the address\nof the last line in the buffer.\n\nIf FILE is prefixed with a bang (!), then it is interpreted as a shell\ncommand whose output is to be read, (*note shell escape command:: '!'\nbelow). In this case the default filename is unchanged.\n\nA warning is printed if any changes have been made in the buffer since\nthe last 'w' command that wrote the entire buffer to a file.\n\n'E FILE'\nEdits FILE unconditionally. This is similar to the 'e' command, except\nthat unwritten changes are discarded without warning.\n\n'f FILE'\nSets the default filename to FILE. If FILE is not specified, then the\ndefault unescaped filename is printed.\n\n'(1,$)g/RE/[I]COMMAND-LIST'\nGlobal command. The global command makes two passes over the file. On\nthe first pass, all the addressed lines matching a regular expression\nRE are marked. The suffix 'I' is a GNU extension which makes 'ed'\nmatch RE in a case-insensitive manner. Then, going sequentially from\nthe beginning of the file to the end of the file, the given\nCOMMAND-LIST is executed for each marked line, with the current\naddress set to the address of that line. Any line modified by the\nCOMMAND-LIST is unmarked. The final value of the current address is\nthe value assigned by the last command in the last COMMAND-LIST\nexecuted. If there were no matching lines, the current address is\nunchanged. The execution of COMMAND-LIST stops on the first error.\n\nThe first command of COMMAND-LIST must appear on the same line as the\n'g' command. The other commands of COMMAND-LIST must appear on\nseparate lines. All lines of a multi-line COMMAND-LIST except the last\nline must be terminated with a backslash ('\\'). Any commands are\nallowed, except for 'g', 'G', 'v', and 'V'. The '.' terminating the\ninput mode of commands 'a', 'c', and 'i' can be omitted if it would be\nthe last line of COMMAND-LIST. By default, a newline alone in\nCOMMAND-LIST is equivalent to a 'p' command. If 'ed' is invoked with\nthe command-line option '-G', then a newline in COMMAND-LIST is\nequivalent to a '.+1p' command.\n\n'(1,$)G/RE/[I]'\nInteractive global command. Interactively edits the addressed lines\nmatching a regular expression RE. The suffix 'I' is a GNU extension\nwhich makes 'ed' match RE in a case-insensitive manner. For each\nmatching line, the line is printed, the current address is set, and\nthe user is prompted to enter a COMMAND-LIST. The final value of the\ncurrent address is the value assigned by the last command executed. If\nthere were no matching lines, the current address is unchanged.\n\nThe format of COMMAND-LIST is the same as that of the 'g' command. A\nnewline alone acts as an empty command list. A single '&' repeats the\nlast non-empty command list.\n\n'h'\nHelp. Prints an explanation of the last error.\n\n'H'\nToggles the printing of error explanations. By default, explanations\nare not printed. It is recommended that ed scripts begin with this\ncommand to aid in debugging.\n\n'(.)i'\nInserts text in the buffer before the addressed line. The address '0'\n(zero) is valid for this command; it places the entered text at the\nbeginning of the buffer. Text is entered in input mode. The current\naddress is set to the address of the last line entered or, if there\nwere none, to the addressed line.\n\n'(.,.+1)j'\nJoins the addressed lines, replacing them by a single line containing\ntheir joined text. If only one address is given, this command does\nnothing. If lines are joined, the lines replaced are copied to the cut\nbuffer and the current address is set to the address of the joined\nline. Else, the current address is unchanged.\n\n'(.)kx'\nMarks a line with a lower case letter 'x'. The line can then be\naddressed as ''x' (i.e., a single quote followed by 'x') in subsequent\ncommands. The mark is not cleared until the line is deleted or\notherwise modified. The current address is unchanged.\n\n'(.,.)l'\nList command. Prints the addressed lines unambiguously. The end of each\nline is marked with a '$', and every '$' character within the text is\nprinted with a preceding backslash. Special characters are printed as\nescape sequences. The current address is set to the address of the\nlast line printed.\n\n'(.,.)m(.)'\nMoves lines in the buffer. The addressed lines are moved to after the\nright-hand destination address. The destination address '0' (zero) is\nvalid for this command; it moves the addressed lines to the beginning\nof the buffer. It is an error if the destination address falls within\nthe range of lines to be moved. The current address is set to the new\naddress of the last line moved.\n\n'(.,.)n'\nNumber command. Prints the addressed lines, preceding each line by its\nline number and a <tab>. The current address is set to the address of\nthe last line printed.\n\n'(.,.)p'\nPrints the addressed lines. The current address is set to the address\nof the last line printed.\n\n'P'\nToggles the command prompt on and off. Unless a prompt string is\nspecified with the command-line option '-p', the command prompt is by\ndefault turned off. The default prompt string is an asterisk ('*').\n\n'q'\nQuits 'ed'. A warning is printed if any changes have been made in the\nbuffer since the last 'w' command that wrote the entire buffer to a\nfile.\n\n'Q'\nQuits 'ed' unconditionally. This is similar to the 'q' command, except\nthat unwritten changes are discarded without warning.\n\n'($)r FILE'\nReads FILE and appends it after the addressed line. If FILE is not\nspecified, then the default filename is used. If there is no default\nfilename prior to the command, then the default filename is set to\nFILE. Otherwise, the default filename is unchanged. The address '0'\n(zero) is valid for this command; it reads the file at the beginning\nof the buffer. The current address is set to the address of the last\nline read or, if there were none, to the addressed line.\n\nIf FILE is prefixed with a bang (!), then it is interpreted as a shell\ncommand whose output is to be read, (*note shell escape command:: '!'\nbelow). In this case the default filename is unchanged.\n\n'(.,.)t(.)'\nCopies (i.e., transfers) the addressed lines to after the right-hand\ndestination address. If the destination address is '0' (zero), the\nlines are copied at the beginning of the buffer. The current address is\nset to the address of the last line copied.\n\n'u'\nUndoes the effect of the last command that modified anything in the\nbuffer and restores the current address to what it was before the\ncommand. The global commands 'g', 'G', 'v', and 'V' are treated as a\nsingle command by undo. 'u' is its own inverse; it can undo only the\nlast command.\n\n'(1,$)v/RE/[I]COMMAND-LIST'\nThis is similar to the 'g' command except that it applies COMMAND-LIST\nto each of the addressed lines not matching the regular expression RE.\n\n'(1,$)V/RE/[I]'\nThis is similar to the 'G' command except that it interactively edits\nthe addressed lines not matching the regular expression RE.\n\n'(1,$)w FILE'\nWrites the addressed lines to FILE. Any previous contents of FILE are\nlost without warning. If there is no default filename, then the\ndefault filename is set to FILE, otherwise it is unchanged. If no\nfilename is specified, then the default filename is used. The current\naddress is unchanged.\n\nIf FILE is prefixed with a bang (!), then it is interpreted as a shell\ncommand and the addressed lines are written to its standard input,\n(*note shell escape command:: '!' below). In this case the default\nfilename is unchanged. Writing the buffer to a shell command does not\nprevent the warning to the user if an attempt is made to overwrite or\ndiscard the buffer via the 'e' or 'q' commands.\n\n'(1,$)wq FILE'\nWrites the addressed lines to FILE, and then executes a 'q' command.\n\n'(1,$)W FILE'\nAppends the addressed lines to the end of FILE. This is similar to the\n'w' command, except that the previous contents of FILE are not\nclobbered. The current address is unchanged.\n\n'(.)x'\nCopies (puts) the contents of the cut buffer to after the addressed\nline. The current address is set to the address of the last line\ncopied.\n\n'(.,.)y'\nCopies (yanks) the addressed lines to the cut buffer. The cut buffer is\noverwritten by subsequent 'c', 'd', 'j', 's', or 'y' commands. The\ncurrent address is unchanged.\n\n'(.+1)zN'\nScroll. Prints N lines at a time starting at addressed line, and sets\nwindow size to N. If N is not specified, then the current window size\nis used. Window size defaults to screen size minus two lines, or to 22\nif screen size can't be determined. The current address is set to the\naddress of the last line printed.\n\n'!COMMAND'\nShell escape command. Executes COMMAND via 'sh (1)'. If the first\ncharacter of COMMAND is '!', then it is replaced by the text of the\nprevious '!COMMAND'. Thus, '!!' repeats the previous '!COMMAND'. 'ed'\ndoes not process COMMAND for backslash ('\\') escapes. However, each\nunescaped '%' is replaced with the default filename, and the backslash\nis removed from each escaped '%'. When the shell returns from\nexecution, a '!' is printed to the standard output. The current\naddress is unchanged.\n\n'(.,.)#'\nBegins a comment; the rest of the line, up to a newline, is ignored.\nIf a line address followed by a semicolon is given, then the current\naddress is set to that address. Otherwise, the current address is\nunchanged.\n\n'($)='\nPrints the line number of the addressed line. The current address is\nunchanged.\n\n'(.+1)<newline>'\nNull command. An address alone prints the addressed line. A <newline>\nalone is equivalent to '+1p'. The current address is set to the address\nof the printed line.\n\n\nFile: ed.info,  Node: The 's' Command,  Next: Limitations,  Prev: Commands,  Up: Top\n",
            "subsections": []
        },
        "7 Substitute command": {
            "content": "The substitute command 's' replaces text in the addressed lines matching a\nregular expression RE with REPLACEMENT. By default, only the first match in\neach line is replaced. The syntax of the 's' command is:\n\n(.,.)s/RE/REPLACEMENT/[SUFFIXES]\n\nThe 's' command accepts any combination of the following optional\nsuffixes:\n\n'g'\n'global': replace every match in the line, not just the first.\n\n'COUNT'\nA positive number causes only the COUNTth match to be replaced. 'g'\nand 'COUNT' can't be specified in the same command.\n\n'l'\n'n'\n'p'\nThe usual print suffixes. *Note print suffixes::.\n\n'I'\n'i'\nThe suffix 'I' is a GNU extension which makes 'ed' match RE in a\ncase-insensitive manner.\n\n\nIt is an error if no substitutions are performed on any of the addressed\nlines. The current address is set to the address of the last line on which a\nsubstitution occurred. If a line is split, a substitution is considered to\nhave occurred on each of the new lines. If no substitution is performed, the\ncurrent address is unchanged. The last line modified is copied to the cut\nbuffer.\n\nRE and REPLACEMENT may be delimited by any character other than <space>,\n<newline> and the characters used by the form of the 's' command shown\nbelow. If the last delimiter is omitted, then the last line affected is\nprinted as if the print suffix 'p' were specified. The last delimiter can't\nbe omitted if the 's' command is part of a 'g' or 'v' COMMAND-LIST and is\nnot the last command in the list, because the meaning of the following\nescaped newline would become ambiguous.\n\nAn unescaped '&' in REPLACEMENT is replaced by the currently matched\ntext. The character sequence '\\M' where M is a number in the range [1,9],\nis replaced by the Mth backreference expression of the matched text. If the\ncorresponding backreference expression does not match, then the character\nsequence '\\M' is replaced by the empty string. If REPLACEMENT consists of a\nsingle '%', then REPLACEMENT from the last substitution is used.\n\nA line can be split by including a newline escaped with a backslash\n('\\') in REPLACEMENT. Each backslash in REPLACEMENT removes the special\nmeaning (if any) of the following character.\n\n'ed' can repeat the last substitution using the following alternative\nsyntax for the 's' command:\n\n(.,.)s[SUFFIXES]\n\nThis form of the 's' command accepts the suffixes 'g' and 'COUNT'\ndescribed above, and any combination of the suffixes 'p' and 'r'. The\nsuffix 'g' toggles the global suffix of the last substitution and resets\nCOUNT to 1. The suffix 'p' toggles the print suffixes of the last\nsubstitution. The suffix 'r' causes the RE of the last search to be used\ninstead of the RE of the last substitution (if the search happened after\nthe substitution).\n\nFile: ed.info,  Node: Limitations,  Next: Diagnostics,  Prev: The 's' Command,  Up: Top\n",
            "subsections": []
        },
        "8 Limitations": {
            "content": "If the terminal hangs up, 'ed' attempts to write the buffer to the file\n'ed.hup' or, if this fails, to '$HOME/ed.hup'.\n\n'ed' processes FILE arguments for backslash escapes, i.e., in a\nfilename, any character preceded by a backslash ('\\') is interpreted\nliterally. For example, 'ed 'hello\\tworld'' will edit the file\n'hellotworld'.\n\nIf a text (non-binary) file is not terminated by a newline character,\nthen 'ed' appends one on reading/writing it. In the case of a binary file,\n'ed' does not append a newline on reading/writing. A binary file is one\ncontaining at least one ASCII NUL character. If the last line has been\nmodified, reading an empty file, for example /dev/null, prior to writing\nprevents appending a newline to a binary file.\n\nIn order to keep track of the text lines in the buffer, 'ed' uses a\ndoubly linked list of structures containing the position and size of each\nline. This results in a per line overhead of 2 'pointer's, 1 'long int',\nand 1 'int'. The maximum line length is INTMAX - 1 bytes. The maximum\nnumber of lines is INTMAX - 2 lines.\n\nFile: ed.info,  Node: Diagnostics,  Next: Problems,  Prev: Limitations,  Up: Top\n",
            "subsections": []
        },
        "9 Diagnostics": {
            "content": "When an error occurs, if 'ed''s input is from a regular file or here\ndocument, then it exits, otherwise it prints a '?' and returns to command\nmode. An explanation of the last error can be printed with the 'h' (help)\ncommand.\n\nIf the 'u' (undo) command occurs in a global command list, then the\ncommand list is executed only once.\n\nAttempting to quit 'ed' or edit another file before writing a modified\nbuffer results in an error. If the command is entered a second time, it\nsucceeds, but any changes to the buffer are lost.\n\nFile: ed.info,  Node: Problems,  Next: GNU Free Documentation License,  Prev: Diagnostics,  Up: Top\n",
            "subsections": []
        },
        "10 Reporting bugs": {
            "content": "There are probably bugs in 'ed'. There are certainly errors and omissions\nin this manual. If you report them, they will get fixed. If you don't, no\none will ever know about them and they will remain unfixed for all\neternity, if not longer.\n\nIf you find a bug in 'ed', please send electronic mail to\n<bug-ed@gnu.org>. Include the version number, which you can find by running\n'ed --version'.\n\nFile: ed.info,  Node: GNU Free Documentation License,  Prev: Problems,  Up: Top\n",
            "subsections": []
        },
        "11 GNU Free Documentation License": {
            "content": "Version 1.3, 3 November 2008\n\nCopyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.\n'http://fsf.org/'\n\nEveryone is permitted to copy and distribute verbatim copies\nof this license document, but changing it is not allowed.\n\n0. PREAMBLE\n\nThe purpose of this License is to make a manual, textbook, or other\nfunctional and useful document \"free\" in the sense of freedom: to\nassure everyone the effective freedom to copy and redistribute it,\nwith or without modifying it, either commercially or noncommercially.\nSecondarily, this License preserves for the author and publisher a way\nto get credit for their work, while not being considered responsible\nfor modifications made by others.\n\nThis License is a kind of \"copyleft\", which means that derivative\nworks of the document must themselves be free in the same sense.  It\ncomplements the GNU General Public License, which is a copyleft\nlicense designed for free software.\n\nWe have designed this License in order to use it for manuals for free\nsoftware, because free software needs free documentation: a free\nprogram should come with manuals providing the same freedoms that the\nsoftware does.  But this License is not limited to software manuals;\nit can be used for any textual work, regardless of subject matter or\nwhether it is published as a printed book.  We recommend this License\nprincipally for works whose purpose is instruction or reference.\n\n1. APPLICABILITY AND DEFINITIONS\n\nThis License applies to any manual or other work, in any medium, that\ncontains a notice placed by the copyright holder saying it can be\ndistributed under the terms of this License.  Such a notice grants a\nworld-wide, royalty-free license, unlimited in duration, to use that\nwork under the conditions stated herein.  The \"Document\", below,\nrefers to any such manual or work.  Any member of the public is a\nlicensee, and is addressed as \"you\".  You accept the license if you\ncopy, modify or distribute the work in a way requiring permission\nunder copyright law.\n\nA \"Modified Version\" of the Document means any work containing the\nDocument or a portion of it, either copied verbatim, or with\nmodifications and/or translated into another language.\n\nA \"Secondary Section\" is a named appendix or a front-matter section of\nthe Document that deals exclusively with the relationship of the\npublishers or authors of the Document to the Document's overall\nsubject (or to related matters) and contains nothing that could fall\ndirectly within that overall subject.  (Thus, if the Document is in\npart a textbook of mathematics, a Secondary Section may not explain\nany mathematics.)  The relationship could be a matter of historical\nconnection with the subject or with related matters, or of legal,\ncommercial, philosophical, ethical or political position regarding\nthem.\n\nThe \"Invariant Sections\" are certain Secondary Sections whose titles\nare designated, as being those of Invariant Sections, in the notice\nthat says that the Document is released under this License.  If a\nsection does not fit the above definition of Secondary then it is not\nallowed to be designated as Invariant.  The Document may contain zero\nInvariant Sections.  If the Document does not identify any Invariant\nSections then there are none.\n\nThe \"Cover Texts\" are certain short passages of text that are listed,\nas Front-Cover Texts or Back-Cover Texts, in the notice that says that\nthe Document is released under this License.  A Front-Cover Text may\nbe at most 5 words, and a Back-Cover Text may be at most 25 words.\n\nA \"Transparent\" copy of the Document means a machine-readable copy,\nrepresented in a format whose specification is available to the\ngeneral public, that is suitable for revising the document\nstraightforwardly with generic text editors or (for images composed of\npixels) generic paint programs or (for drawings) some widely available\ndrawing editor, and that is suitable for input to text formatters or\nfor automatic translation to a variety of formats suitable for input\nto text formatters.  A copy made in an otherwise Transparent file\nformat whose markup, or absence of markup, has been arranged to thwart\nor discourage subsequent modification by readers is not Transparent.\nAn image format is not Transparent if used for any substantial amount\nof text.  A copy that is not \"Transparent\" is called \"Opaque\".\n\nExamples of suitable formats for Transparent copies include plain\nASCII without markup, Texinfo input format, LaTeX input format, SGML\nor XML using a publicly available DTD, and standard-conforming simple\nHTML, PostScript or PDF designed for human modification.  Examples of\ntransparent image formats include PNG, XCF and JPG.  Opaque formats\ninclude proprietary formats that can be read and edited only by\nproprietary word processors, SGML or XML for which the DTD and/or\nprocessing tools are not generally available, and the\nmachine-generated HTML, PostScript or PDF produced by some word\nprocessors for output purposes only.\n\nThe \"Title Page\" means, for a printed book, the title page itself,\nplus such following pages as are needed to hold, legibly, the material\nthis License requires to appear in the title page.  For works in\nformats which do not have any title page as such, \"Title Page\" means\nthe text near the most prominent appearance of the work's title,\npreceding the beginning of the body of the text.\n\nThe \"publisher\" means any person or entity that distributes copies of\nthe Document to the public.\n\nA section \"Entitled XYZ\" means a named subunit of the Document whose\ntitle either is precisely XYZ or contains XYZ in parentheses following\ntext that translates XYZ in another language.  (Here XYZ stands for a\nspecific section name mentioned below, such as \"Acknowledgements\",\n\"Dedications\", \"Endorsements\", or \"History\".)  To \"Preserve the Title\"\nof such a section when you modify the Document means that it remains a\nsection \"Entitled XYZ\" according to this definition.\n\nThe Document may include Warranty Disclaimers next to the notice which\nstates that this License applies to the Document.  These Warranty\nDisclaimers are considered to be included by reference in this\nLicense, but only as regards disclaiming warranties: any other\nimplication that these Warranty Disclaimers may have is void and has\nno effect on the meaning of this License.\n\n2. VERBATIM COPYING\n\nYou may copy and distribute the Document in any medium, either\ncommercially or noncommercially, provided that this License, the\ncopyright notices, and the license notice saying this License applies\nto the Document are reproduced in all copies, and that you add no other\nconditions whatsoever to those of this License.  You may not use\ntechnical measures to obstruct or control the reading or further\ncopying of the copies you make or distribute.  However, you may accept\ncompensation in exchange for copies.  If you distribute a large enough\nnumber of copies you must also follow the conditions in section 3.\n\nYou may also lend copies, under the same conditions stated above, and\nyou may publicly display copies.\n\n3. COPYING IN QUANTITY\n\nIf you publish printed copies (or copies in media that commonly have\nprinted covers) of the Document, numbering more than 100, and the\nDocument's license notice requires Cover Texts, you must enclose the\ncopies in covers that carry, clearly and legibly, all these Cover\nTexts: Front-Cover Texts on the front cover, and Back-Cover Texts on\nthe back cover.  Both covers must also clearly and legibly identify\nyou as the publisher of these copies.  The front cover must present\nthe full title with all words of the title equally prominent and\nvisible.  You may add other material on the covers in addition.\nCopying with changes limited to the covers, as long as they preserve\nthe title of the Document and satisfy these conditions, can be treated\nas verbatim copying in other respects.\n\nIf the required texts for either cover are too voluminous to fit\nlegibly, you should put the first ones listed (as many as fit\nreasonably) on the actual cover, and continue the rest onto adjacent\npages.\n\nIf you publish or distribute Opaque copies of the Document numbering\nmore than 100, you must either include a machine-readable Transparent\ncopy along with each Opaque copy, or state in or with each Opaque copy\na computer-network location from which the general network-using\npublic has access to download using public-standard network protocols\na complete Transparent copy of the Document, free of added material.\nIf you use the latter option, you must take reasonably prudent steps,\nwhen you begin distribution of Opaque copies in quantity, to ensure\nthat this Transparent copy will remain thus accessible at the stated\nlocation until at least one year after the last time you distribute an\nOpaque copy (directly or through your agents or retailers) of that\nedition to the public.\n\nIt is requested, but not required, that you contact the authors of the\nDocument well before redistributing any large number of copies, to give\nthem a chance to provide you with an updated version of the Document.\n\n4. MODIFICATIONS\n\nYou may copy and distribute a Modified Version of the Document under\nthe conditions of sections 2 and 3 above, provided that you release\nthe Modified Version under precisely this License, with the Modified\nVersion filling the role of the Document, thus licensing distribution\nand modification of the Modified Version to whoever possesses a copy\nof it.  In addition, you must do these things in the Modified Version:\n\nA. Use in the Title Page (and on the covers, if any) a title distinct\nfrom that of the Document, and from those of previous versions\n(which should, if there were any, be listed in the History section\nof the Document).  You may use the same title as a previous\nversion if the original publisher of that version gives\npermission.\n\nB. List on the Title Page, as authors, one or more persons or\nentities responsible for authorship of the modifications in the\nModified Version, together with at least five of the principal\nauthors of the Document (all of its principal authors, if it has\nfewer than five), unless they release you from this requirement.\n\nC. State on the Title page the name of the publisher of the Modified\nVersion, as the publisher.\n\nD. Preserve all the copyright notices of the Document.\n\nE. Add an appropriate copyright notice for your modifications\nadjacent to the other copyright notices.\n\nF. Include, immediately after the copyright notices, a license notice\ngiving the public permission to use the Modified Version under the\nterms of this License, in the form shown in the Addendum below.\n\nG. Preserve in that license notice the full lists of Invariant\nSections and required Cover Texts given in the Document's license\nnotice.\n\nH. Include an unaltered copy of this License.\n\nI. Preserve the section Entitled \"History\", Preserve its Title, and\nadd to it an item stating at least the title, year, new authors,\nand publisher of the Modified Version as given on the Title Page.\nIf there is no section Entitled \"History\" in the Document, create\none stating the title, year, authors, and publisher of the\nDocument as given on its Title Page, then add an item describing\nthe Modified Version as stated in the previous sentence.\n\nJ. Preserve the network location, if any, given in the Document for\npublic access to a Transparent copy of the Document, and likewise\nthe network locations given in the Document for previous versions\nit was based on.  These may be placed in the \"History\" section.\nYou may omit a network location for a work that was published at\nleast four years before the Document itself, or if the original\npublisher of the version it refers to gives permission.\n\nK. For any section Entitled \"Acknowledgements\" or \"Dedications\",\nPreserve the Title of the section, and preserve in the section\nall the substance and tone of each of the contributor\nacknowledgements and/or dedications given therein.\n\nL. Preserve all the Invariant Sections of the Document, unaltered in\ntheir text and in their titles.  Section numbers or the\nequivalent are not considered part of the section titles.\n\nM. Delete any section Entitled \"Endorsements\".  Such a section may\nnot be included in the Modified Version.\n\nN. Do not retitle any existing section to be Entitled \"Endorsements\"\nor to conflict in title with any Invariant Section.\n\nO. Preserve any Warranty Disclaimers.\n\nIf the Modified Version includes new front-matter sections or\nappendices that qualify as Secondary Sections and contain no material\ncopied from the Document, you may at your option designate some or all\nof these sections as invariant.  To do this, add their titles to the\nlist of Invariant Sections in the Modified Version's license notice.\nThese titles must be distinct from any other section titles.\n\nYou may add a section Entitled \"Endorsements\", provided it contains\nnothing but endorsements of your Modified Version by various\nparties--for example, statements of peer review or that the text has\nbeen approved by an organization as the authoritative definition of a\nstandard.\n\nYou may add a passage of up to five words as a Front-Cover Text, and a\npassage of up to 25 words as a Back-Cover Text, to the end of the list\nof Cover Texts in the Modified Version.  Only one passage of\nFront-Cover Text and one of Back-Cover Text may be added by (or\nthrough arrangements made by) any one entity.  If the Document already\nincludes a cover text for the same cover, previously added by you or\nby arrangement made by the same entity you are acting on behalf of,\nyou may not add another; but you may replace the old one, on explicit\npermission from the previous publisher that added the old one.\n\nThe author(s) and publisher(s) of the Document do not by this License\ngive permission to use their names for publicity for or to assert or\nimply endorsement of any Modified Version.\n\n5. COMBINING DOCUMENTS\n\nYou may combine the Document with other documents released under this\nLicense, under the terms defined in section 4 above for modified\nversions, provided that you include in the combination all of the\nInvariant Sections of all of the original documents, unmodified, and\nlist them all as Invariant Sections of your combined work in its\nlicense notice, and that you preserve all their Warranty Disclaimers.\n\nThe combined work need only contain one copy of this License, and\nmultiple identical Invariant Sections may be replaced with a single\ncopy.  If there are multiple Invariant Sections with the same name but\ndifferent contents, make the title of each such section unique by\nadding at the end of it, in parentheses, the name of the original\nauthor or publisher of that section if known, or else a unique number.\nMake the same adjustment to the section titles in the list of\nInvariant Sections in the license notice of the combined work.\n\nIn the combination, you must combine any sections Entitled \"History\"\nin the various original documents, forming one section Entitled\n\"History\"; likewise combine any sections Entitled \"Acknowledgements\",\nand any sections Entitled \"Dedications\".  You must delete all sections\nEntitled \"Endorsements.\"\n\n6. COLLECTIONS OF DOCUMENTS\n\nYou may make a collection consisting of the Document and other\ndocuments released under this License, and replace the individual\ncopies of this License in the various documents with a single copy\nthat is included in the collection, provided that you follow the rules\nof this License for verbatim copying of each of the documents in all\nother respects.\n\nYou may extract a single document from such a collection, and\ndistribute it individually under this License, provided you insert a\ncopy of this License into the extracted document, and follow this\nLicense in all other respects regarding verbatim copying of that\ndocument.\n\n7. AGGREGATION WITH INDEPENDENT WORKS\n\nA compilation of the Document or its derivatives with other separate\nand independent documents or works, in or on a volume of a storage or\ndistribution medium, is called an \"aggregate\" if the copyright\nresulting from the compilation is not used to limit the legal rights\nof the compilation's users beyond what the individual works permit.\nWhen the Document is included in an aggregate, this License does not\napply to the other works in the aggregate which are not themselves\nderivative works of the Document.\n\nIf the Cover Text requirement of section 3 is applicable to these\ncopies of the Document, then if the Document is less than one half of\nthe entire aggregate, the Document's Cover Texts may be placed on\ncovers that bracket the Document within the aggregate, or the\nelectronic equivalent of covers if the Document is in electronic form.\nOtherwise they must appear on printed covers that bracket the whole\naggregate.\n\n8. TRANSLATION\n\nTranslation is considered a kind of modification, so you may\ndistribute translations of the Document under the terms of section 4.\nReplacing Invariant Sections with translations requires special\npermission from their copyright holders, but you may include\ntranslations of some or all Invariant Sections in addition to the\noriginal versions of these Invariant Sections.  You may include a\ntranslation of this License, and all the license notices in the\nDocument, and any Warranty Disclaimers, provided that you also include\nthe original English version of this License and the original versions\nof those notices and disclaimers.  In case of a disagreement between\nthe translation and the original version of this License or a notice\nor disclaimer, the original version will prevail.\n\nIf a section in the Document is Entitled \"Acknowledgements\",\n\"Dedications\", or \"History\", the requirement (section 4) to Preserve\nits Title (section 1) will typically require changing the actual title.\n\n9. TERMINATION\n\nYou may not copy, modify, sublicense, or distribute the Document\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense, or distribute it is void, and\nwill automatically terminate your rights under this License.\n\nHowever, if you cease all violation of this License, then your license\nfrom a particular copyright holder is reinstated (a) provisionally,\nunless and until the copyright holder explicitly and finally\nterminates your license, and (b) permanently, if the copyright holder\nfails to notify you of the violation by some reasonable means prior to\n60 days after the cessation.\n\nMoreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\nTermination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, receipt of a copy of some or all of the same material does\nnot give you any rights to use it.\n\n10. FUTURE REVISIONS OF THIS LICENSE\n\nThe Free Software Foundation may publish new, revised versions of the\nGNU Free Documentation License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in\ndetail to address new problems or concerns.  See\n'http://www.gnu.org/copyleft/'.\n\nEach version of the License is given a distinguishing version number.\nIf the Document specifies that a particular numbered version of this\nLicense \"or any later version\" applies to it, you have the option of\nfollowing the terms and conditions either of that specified version or\nof any later version that has been published (not as a draft) by the\nFree Software Foundation.  If the Document does not specify a version\nnumber of this License, you may choose any version ever published (not\nas a draft) by the Free Software Foundation.  If the Document\nspecifies that a proxy can decide which future versions of this\nLicense can be used, that proxy's public statement of acceptance of a\nversion permanently authorizes you to choose that version for the\nDocument.\n\n11. RELICENSING\n\n\"Massive Multiauthor Collaboration Site\" (or \"MMC Site\") means any\nWorld Wide Web server that publishes copyrightable works and also\nprovides prominent facilities for anybody to edit those works.  A\npublic wiki that anybody can edit is an example of such a server.  A\n\"Massive Multiauthor Collaboration\" (or \"MMC\") contained in the site\nmeans any set of copyrightable works thus published on the MMC site.\n\n\"CC-BY-SA\" means the Creative Commons Attribution-Share Alike 3.0\nlicense published by Creative Commons Corporation, a not-for-profit\ncorporation with a principal place of business in San Francisco,\nCalifornia, as well as future copyleft versions of that license\npublished by that same organization.\n\n\"Incorporate\" means to publish or republish a Document, in whole or in\npart, as part of another Document.\n\nAn MMC is \"eligible for relicensing\" if it is licensed under this\nLicense, and if all works that were first published under this License\nsomewhere other than this MMC, and subsequently incorporated in whole\nor in part into the MMC, (1) had no cover texts or invariant sections,\nand (2) were thus incorporated prior to November 1, 2008.\n\nThe operator of an MMC Site may republish an MMC contained in the site\nunder CC-BY-SA on the same site at any time before August 1, 2009,\nprovided the MMC is eligible for relicensing.\n\n",
            "subsections": [
                {
                    "name": "ADDENDUM: How to use this License for your documents",
                    "content": "To use this License in a document you have written, include a copy of the\nLicense in the document and put the following copyright and license notices\njust after the title page:\n\nCopyright (C)  YEAR  YOUR NAME.\nPermission is granted to copy, distribute and/or modify this document\nunder the terms of the GNU Free Documentation License, Version 1.3\nor any later version published by the Free Software Foundation;\nwith no Invariant Sections, no Front-Cover Texts, and no Back-Cover\nTexts.  A copy of the license is included in the section entitled ``GNU\nFree Documentation License''.\n\nIf you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,\nreplace the \"with...Texts.\" line with this:\n\nwith the Invariant Sections being LIST THEIR TITLES, with\nthe Front-Cover Texts being LIST, and with the Back-Cover Texts\nbeing LIST.\n\nIf you have Invariant Sections without Cover Texts, or some other\ncombination of the three, merge those two alternatives to suit the\nsituation.\n\nIf your document contains nontrivial examples of program code, we\nrecommend releasing these examples in parallel under your choice of free\nsoftware license, such as the GNU General Public License, to permit their\nuse in free software.\n\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}