ed revision 1.1
11.1Scgdprepare to add text at beginning of file:0a|1i 21.1Scgdfind name of file being edited:f 31.1Scgdprint last 3 lines of file:$-[2|-],$p 41.1Scgdprint previous line:[-|^]{p}|{.}-{1}{p} 51.1Scgdprint whole file:1,$p|g/[^|$]/p 61.1Scgddelete this line and next:.{,|;}[{.}+{1}|.1]d 71.1Scgdprepare to replace text from here to just before next "PP":\ 81.1Scgd.{,|;}/[PP|{^}\\.PP]/-{1}c 91.1Scgdfind next "1.2":/1\\.2/{p} 101.1Scgdfind next 2-or-more digit number:\ 111.1Scgd/\[[0|1]-9\]\[0-9\]/{p} 121.1Scgdmove rest of this paragraph (separated by "PP") to end of previous one:\ 131.1Scgd[.,|{.}+{1},|.1,]/[PP|{^}\\.PP]/-{1}m[??|?{^}{\\.}PP?]-{1} 141.1Scgdprint every "Oxygen" or "oxygen":[g|1,$g]/\[[Oo|oO]\]xygen/[p|.p] 151.1Scgdchange each "BTL" in file to "Bell Laboratories" and check:\ 161.1Scgd[g|1,$g]/BTL/[s|.s]/[/|BTL/]Bell Laboratories/gp 171.1Scgdcombine every even-numbered line with the next odd-numbered line:\ 181.1Scgd2,${-{1}}g/[^|$]/[j|.,{.}+{1}j|.,.1j] 191.1Scgdprint next "SH" and following line:\ 201.1Scgd/SH/;[{.}+{1}|.1]p|/SH/,[//|/SH/][{.}+{1}|.1]p 211.1Scgdprint from next "TS" to following "TE":/TS/;/TE/p 221.1Scgdreverse order of lines in whole file:[g|1,$g]/^/[m|.m]0 231.1Scgdreplace each string of x's in current line by one x:\ 241.1Scgd[s|.s]/[x|\[x\]][x|\[x\]]*/x/g{p}{ (not s/x*/x/g)} 251.1Scgdchange first "hte" in current line to "the" and check:[s|.s]/hte/the/p 261.1Scgdcombine previous line and this one:\ 271.1Scgd[-,|^,|{.}-{1},].j 281.1Scgdgo to line after third "PP" ahead:\ 291.1Scgd/[PP|{^}\\.PP]/;[//|/[PP|{^}\\.PP]/];[//|/[PP|{^}\\.PP]/]\ 301.1Scgd[{+}1|+]|;[{.}+{1}|.1]{ (not ...p)} 311.1Scgdexchange current line with previous line:\ 321.1Scgd[[-|^]m|{.}-{1}m].|{.}m[[--|^^]|{.}-2] 331.1Scgdmove everything from here through "stop." to end of file:\ 341.1Scgd.,/stop\\./m$ 351.1Scgdcurrent line has 2 fields separated by 1 blank; exchange them:\ 361.1Scgd[s|.s]/[\\|^\\]([.|\[^ \]]*\\) \\([.|\[^ \]]*\\)[/|$/]\\2 \\1/{p} 371.1Scgdinsert a "0" after last "0" on current line:\ 381.1Scgd[s|.s]/[.*0/&0|^.*0/&0|0\\(\[^0\]*\\)$/[0&|00\1]|0\[^0\]*$/0&\ 391.1Scgd|\[^0\]*$/0&]/{p} 401.1Scgdreplace "a*b" by "a**b":s/[a\\*b|a[*]b]/a**b/{p}|\ 411.1Scgds/\\*/**/p 421.1Scgdattach the word "extra" to the end of the current line:\ 431.1Scgd[s|.s]/$/{ }extra/{p} 441.1Scgdreplace "ATT" in current line by "AT&T":\ 451.1Scgd[s|.s]/ATT/AT\\&T/{g}{p} 461.1Scgddouble the length of the current line by repetition:\ 471.1Scgd[s|.s]/[.*|.|^.*$]/&&/{p} 481.1Scgdlook for another line containing what you just looked for:// 491.1Scgdfind the previous line that contains a capital letter:?\[A-Z\]?{p} 501.1Scgddelete the next line that contains only capital letters:\ 511.1Scgd/^\[A-Z\]*$/d|/^\[A-Z\]\[A-Z\]*$/d 521.1Scgdplace a copy of current line at the end of the file:\ 531.1Scgdt$|.{,.}t$ 541.1Scgdfind how many lines there are:=|$= 551.1Scgdfind the number of the current line:.= 561.1Scgddelete the first 3 lines of the file:1,3d 571.1Scgddelete every line that doesn't begin with "A":\ 581.1Scgd[v|1,$v]/^A/d{ (not g/^\[^A\]/d)} 591.1Scgddelete every empty line from here through next "LP":\ 601.1Scgd.,/[LP|{{^}\\.}LP]/g/^$/d 611.1Scgdprint the line after each "AU":\ 621.1Scgd[g|1,$g]/[AU|{^}\\.AU]/[{.}+{1}|.1]{p} 631.1Scgddelete everything after "proud" from current line:\ 641.1Scgd[s|.s]/proud.*/proud/{p} 651.1Scgddelete part of current line from "alpha" through "omega":\ 661.1Scgd[s|.s]/alpha.*omega//{p} 671.1Scgdsave everything up through current line in file "prefix":1,.w prefix 681.1Scgdprepare to add text at end of file:$a 691.1Scgdappend the contents of file "suffix" to this file:$r suffix 701.1Scgdgo back 10 lines:{.}-10{p}|---------- 711.1Scgdchange every "01" in current line to "1":[s|.s]/01/1/g{p} 721.1Scgdgo to next line that contains a double capital letter:\ 731.1Scgd/\\(\[A-Z\]\\)\\1/{p} 741.1Scgdplace parens () around current line:\ 751.1Scgd[s|.s]/[.*|^.*$]/(&)/{p} 761.1Scgdthe current line is too long for your terminal; print it to fit:\ 771.1Scgdl|.l 781.1Scgdput the work you've done back in the original file:w 791.1Scgdappend the whole file to the file "unfinished":\ 801.1Scgd[W|1,$W] unfinished 811.1Scgdinsert "\\&" at beginning of current line:\ 821.1Scgd[s|.s]/^/\\\\\\&/{p} 831.1Scgdlist your current directory:!ls 841.1Scgdstop work on current file and shift to file "other":e other 85