1.\" Copyright (c) 1980, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.proprietary.man% 5.\" 6.\" @(#)ed.1 6.7 (Berkeley) 04/08/91 7.\" 8.Vx 9.Dd 10.Dt ED 1 11.Os ATT 7th 12.Sh NAME 13.Nm ed 14.Nd text editor 15.Sh SYNOPSIS 16.Nm ed 17.Op Fl 18.Op Fl x 19.Op Ar file 20.Sh DESCRIPTION 21.Nm Ed 22is the standard text editor. 23.Pp 24If a 25.Ar file 26argument is given, 27.Nm ed 28simulates an 29.Ic e 30command (see below) on the named file; that is to say, 31the file is read into 32.Nm ed 's 33buffer so that it can be edited. 34.Tw Ds 35.Tp Fl x 36An 37.Ic x 38command is simulated first to handle an encrypted file. 39.Tp Fl 40Suppresses the printing 41of explanatory output 42and should be used 43when the standard input is 44an editor script. 45.Tp 46.Pp 47.Nm Ed 48operates on a copy of any file it is editing; changes made 49in the copy have no effect on the file until a 50.Ic w 51(write) command is given. 52The copy of the text being edited resides 53in a temporary file called the 54.Ar buffer . 55.Pp 56Commands to 57.Nm ed 58have a simple and regular structure: zero or 59more 60.Ar addresses 61followed by a single character 62.Ar command , 63possibly 64followed by parameters to the command. 65These addresses specify one or more lines in the buffer. 66Missing addresses are supplied by default. 67.Pp 68In general, only one command may appear on a line. 69Certain commands allow the 70addition of text to the buffer. 71While 72.Nm ed 73is accepting text, it is said 74to be in 75.Ar input mode . 76In this mode, no commands are recognized; 77all input is merely collected. 78Input mode is left by typing a period 79.Sq Ic \&. 80alone at the 81beginning of a line. 82.Pp 83.Nm Ed 84supports a limited form of 85.Ar regular expression 86notation. 87A regular expression specifies 88a set of strings of characters. 89A member of this set of strings is said to be 90.Ar matched 91by the regular expression. 92In the following specification for regular expressions 93the word `character' means any character but newline. 94.Tw Ds 95.Tp 1. 96Any character except a special character 97matches itself. 98Special characters are 99the regular expression delimiter plus 100.Sq Cm \e\[. 101and sometimes 102.Sq Cm ^*$ . 103.Tp 2. 104A 105.Sq Cm \&. 106matches any character. 107.Tp 3. 108A 109.Sq Li \e 110followed by any character except a digit or 111.Li (\) 112matches that character. 113.Tp 4. 114A nonempty string 115.Op Ar s 116or 117.Oo 118.Cx \&( 119.Op Cm \&^ Ar s 120.Cx \&) 121.Cx 122.Oo 123matches any character in (or not in) 124.Ar s . 125In 126.Ar s , 127.Sq Li \e 128has no special meaning, and 129may only appear as 130the first letter. 131A substring 132.Ar a\-b , 133with 134.Ar a 135and 136.Ar b 137in ascending ASCII order, stands for the inclusive 138range of ASCII characters. 139.Tp 5. 140A regular expression of form 1\-4 followed by * matches a sequence of 1410 or more matches of the regular expression. 142.Tp 6. 143A regular expression, 144.Ar x , 145of form 1\-8, bracketed 146.Cx Li \e( 147.Ar x 148.Li \e) 149.Cx 150matches what 151.Ar x 152matches. 153.Tp 7. 154A \e followed by a digit 155.Ar n 156matches a copy of the string that the 157bracketed regular expression beginning with the 158.Cx Ar n 159.Cx \'th 160.Cx 161.Li \e( 162matched. 163.Tp 8. 164A regular expression of form 1\-8, 165.Ar x , 166followed by a regular expression of form 1\-7, 167.Ar y 168matches a match for 169.Ar x 170followed by a match for 171.Ar y , 172with the 173.Ar x 174match being as long as possible while still permitting a 175.Ar y 176match. 177.Tp 9. 178A regular expression of form 1\-8 preceded by 179.Sq Li ^ 180(or followed by 181.Sq Li $ ) , 182is constrained to matches that 183begin at the left (or end at the right) end of a line. 184.Tp 10. 185A regular expression of form 1\-9 picks out the 186longest among the leftmost matches in a line. 187.Tp 11. 188An empty regular expression stands for a copy of the 189last regular expression encountered. 190.Tp 191.Pp 192Regular expressions are used in addresses to specify 193lines and in one command 194(see 195.Ar s 196below) 197to specify a portion of a line which is to be replaced. 198If it is desired to use one of 199the regular expression metacharacters as an ordinary 200character, that character may be preceded by 201.Sq Li \e . 202This also applies to the character bounding the regular 203expression (often 204.Sq Li \&/ ) 205and to 206.Sq Li \e 207itself. 208.Pp 209To understand addressing in 210.Nm ed 211it is necessary to know that at any time there is a 212.Ar current line. 213Generally speaking, the current line is 214the last line affected by a command; however, 215the exact effect on the current line 216is discussed under the description of 217the command. 218Addresses are constructed as follows. 219.Tw Ds 220.Tp 1. 221The character 222.Sq Ic \&. 223addresses the current line. 224.Tp 2. 225The character 226.Cx ` 227.Ic $ 228.Cx \' 229.Cx 230addresses the last line of the buffer. 231.Tp 3. 232A decimal number 233.Ar n 234addresses the 235.Cx Ar n 236.Cx \'th 237.Cx 238line of the buffer. 239.Tp 4. 240.Cx `\(fm 241.Ar x 242.Cx \' 243.Cx 244addresses the line marked with the name 245.Ar x , 246which must be a lower-case letter. 247Lines are marked with the 248.Ar k 249command described below. 250.Tp 5. 251A regular expression enclosed in slashes 252.Cx ` 253.Li / 254.Cx \' 255.Cx 256addresses 257the line found by searching forward from the current line 258and stopping at the first line containing a 259string that matches the regular expression. 260If necessary the search wraps around to the beginning of the 261buffer. 262.Tp 6. 263A regular expression enclosed in queries 264.Cx ` 265.Li ? 266.Cx \' 267.Cx 268addresses 269the line found by searching backward from the current line 270and stopping at the first line containing 271a string that matches the regular expression. 272If necessary 273the search wraps around to the end of the buffer. 274.Tp 7. 275An address followed by a plus sign 276.Cx ` 277.Li + 278.Cx \' 279.Cx 280or a minus sign 281.Cx ` 282.Li \- 283.Cx \' 284.Cx 285followed by a decimal number specifies that address plus 286(resp. minus) the indicated number of lines. 287The plus sign may be omitted. 288.Tp 8. 289If an address begins with 290.Cx ` 291.Li + 292.Cx \' 293.Cx 294or 295.Cx ` 296.Li \- 297.Cx \' 298.Cx 299the addition or subtraction is taken with respect to the current line; 300e.g. 301.Cx ` 302.Li \-5 303.Cx \' 304.Cx 305is understood to mean 306.Cx ` 307.Li .\-5 308.Cx \' 309.Cx 310.Nm . 311.Tp 9. 312If an address ends with 313.Cx ` 314.Li + 315.Cx \' 316.Cx 317.Cx ` 318.Li \- 319.Cx \', 320.Cx 321then 1 is added (resp. subtracted). 322As a consequence of this rule and rule 8, 323the address 324.Cx ` 325.Li \- 326.Cx \' 327.Cx 328refers to the line before the current line. 329Moreover, 330trailing 331.Cx ` 332.Li + 333.Cx \' 334.Cx 335and 336.Cx ` 337.Li \- 338.Cx \' 339.Cx 340characters 341have cumulative effect, so 342.Cx ` 343.Li \-\- 344.Cx \' 345.Cx 346refers to the current 347line less 2. 348.Tp 10. 349To maintain compatibility with earlier versions of the editor, 350the character 351.Cx ` 352.Li ^ 353.Cx \' 354.Cx 355in addresses is 356equivalent to 357.Cx ` 358.Li \- 359.Cx \'. 360.Cx 361.Tp 362.Pp 363Commands may require zero, one, or two addresses. 364Commands which require no addresses regard the presence 365of an address as an error. 366Commands which accept one or two addresses 367assume default addresses when insufficient are given. 368If more addresses are given than such a command requires, 369the last one or two (depending on what is accepted) are used. 370.Pp 371Addresses are separated from each other typically by a comma 372.Cx ` 373.Li , 374.Cx \' 375.Cx 376They may also be separated by a semicolon 377.Cx ` 378.Li ; 379.Cx \' 380.Cx 381In this case the current line 382.Cx ` 383.Li . 384.Cx \' 385.Cx 386.Nm . 387is set to 388the previous address before the next address is interpreted. 389This feature can be used to determine the starting 390line for forward and backward searches 391.Cx \&(` 392.Li / 393.Cx \' 394.Cx 395.Cx ` 396.Li ? 397.Cx \'). 398.Cx 399The second address of any two-address sequence 400must correspond to a line following the line corresponding to the first address. 401The special form 402.Cx ` 403.Li \&% 404.Cx \' 405.Cx 406is an abbreviation for the address pair 407.Cx ` 408.Li 1,$ 409.Cx \'. 410.Cx 411.Pp 412In the following list of 413.Nm ed 414commands, the default addresses 415are shown in parentheses. 416The parentheses are not part of 417the address, but are used to show that the given addresses are 418the default. 419.Pp 420As mentioned, it is generally illegal for more than one 421command to appear on a line. 422However, most commands may be suffixed by `p' 423or by `l', in which case 424the current line is either 425printed or listed respectively 426in the way discussed below. 427Commands may also be suffixed by `n', 428meaning the output of the command is to 429be line numbered. 430These suffixes may be combined in any order. 431.Tw Ds 432.Tp Cx \&( 433.Ic . 434.Cx \&) 435.Ic a 436.Cx 437.Tp <text> 438.Tp Ic \&. 439The append command reads the given text 440and appends it after the addressed line. 441.Sq Ic \&. 442is left 443on the last line input, if there 444were any, otherwise at the addressed line. 445Address `0' is legal for this command; text is placed 446at the beginning of the buffer. 447.Tp Cx \&( 448.Ic \&. 449.Cx \&, 450.Ic \&. 451.Cx \&) 452.Ic \&c 453.Cx 454.Tp <text> 455.Tp Ic \&. 456The change 457command deletes the addressed lines, then accepts input 458text which replaces these lines. 459.Sq Ic \&. 460is left at the last line input; if there were none, 461it is left at the line preceding the deleted lines. 462.Tp Cx \&( 463.Ic \&. 464.Cx \&, 465.Ic \&. 466.Cx \&) 467.Ic \&d 468.Cx 469The delete command deletes the addressed lines from the buffer. 470The line originally after the last line deleted becomes the current line; 471if the lines deleted were originally at the end, 472the new last line becomes the current line. 473.Tp Cx Ic \&e 474.Cx \&\ \& 475.Ar filename 476.Cx 477The edit 478command causes the entire contents of the buffer to be deleted, 479and then the named file to be read in. 480.Sq Ic \&. 481is set to the last line of the buffer. 482The number of characters read is typed. 483.Ar filename 484is remembered for possible use as a default file name 485in a subsequent 486.Ic r 487or 488.Ic w 489command. 490If 491.Ar filename 492is missing, the remembered name is used. 493.Tp Cx Ic E 494.Cx \&\ \& 495.Ar filename 496.Cx 497This command is the same as 498.Ic e , 499except that no diagnostic results when no 500.Ic w 501has been given since the last buffer alteration. 502.Tp Cx Ic f 503.Cx \&\ \& 504.Ar filename 505.Cx 506The filename command prints the currently remembered file name. 507If 508.Ar filename 509is given, 510the currently remembered file name is changed to 511.Ar filename . 512.Tp Cx \&( 513.Ic \&1 514.Cx \&, 515.Ic \&$ 516.Cx \&) 517.Ic \&g 518.Ar/regular expression/command list 519.Cx 520In the global 521command, the first step is to mark every line which matches 522the given regular expression. 523Then for every such line, the 524given command list is executed with 525.Cx ` 526.Ic \&. 527.Cx \' 528.Cx 529initially set to that line. 530A single command or the first of multiple commands 531appears on the same line with the global command. 532All lines of a multi-line list except the last line must be ended with 533.Cx ` 534.Ic \&\e 535.Cx \'. 536.Cx 537.Ic A , 538.Ic i, 539and 540.Ic c 541commands and associated input are permitted; 542the 543.Cx ` 544.Ic \&. 545.Cx \' 546.Cx 547terminating input mode may be omitted if it would be on the 548last line of the command list. 549The commands 550.Ic g 551and 552.Ic v 553are not permitted in the command list. 554.Tp Cx \&( 555.Ic . 556.Cx \&) 557.Ic i 558.Cx 559.Tp <text> 560.Tp Ic \&. 561This command inserts the given text before the addressed line. 562.Cx ` 563.Ic \&. 564.Cx \' 565.Cx 566is left at the last line input, or, if there were none, 567at the line before the addressed line. 568This command differs from the 569.Ic a 570command only in the placement of the 571text. 572.Tp Cx \&( 573.Ic \&. 574.Cx \&, 575.Ic \&.+1 576.Cx \&) 577.Ic \&j 578.Cx 579This command joins the addressed lines into a single line; 580intermediate newlines simply disappear. 581.Cx ` 582.Ic \&. 583.Cx \' 584.Cx 585is left at the resulting line. 586.Tp Cx \&( 587.Ic . 588.Cx \&) 589.Ic k 590.Ar x 591.Cx 592The mark command marks the addressed line with 593name 594.Ar x , 595which must be a lower-case letter. 596The address form 597.Cx `\(fm 598.Ar x 599.Cx \' 600.Cx 601then addresses this line. 602.Tp Cx \&( 603.Ic \&. 604.Cx \&, 605.Ic \&. 606.Cx \&) 607.Ic \&l 608.Cx 609The list command 610prints the addressed lines in an unambiguous way: 611non-graphic characters are 612printed in two-digit octal, 613and long lines are folded. 614The 615.Ar l 616command may be placed on the same line after any non-i/o 617command. 618.Tp Cx \&( 619.Ic \&. 620.Cx \&, 621.Ic \&. 622.Cx \&) 623.Ic \&m 624.Ar a 625.Cx 626The move command repositions the addressed lines after the line 627addressed by 628.Ar a . 629The last of the moved lines becomes the current line. 630.Tp Cx \&( 631.Ic \&. 632.Cx \&, 633.Ic \&. 634.Cx \&) 635.Ic \&p 636.Cx 637The print command prints the addressed lines. 638.Cx ` 639.Ic \&. 640.Cx \' 641.Cx 642is left at the last line printed. 643The 644.Ic p 645command 646may 647be placed on the same line after any non-i/o command. 648.Tp Cx \&( 649.Ic \&. 650.Cx \&, 651.Ic \&. 652.Cx \&) 653.Ic \&P 654.Cx 655This command is a synonym for 656.Ic p . 657.Tp Ic q 658The quit command causes 659.Nm ed 660to exit. 661No automatic write 662of a file is done. 663.Tp Ic Q 664This command is the same as 665.Ic q , 666except that no diagnostic results when no 667.Ic w 668has been given since the last buffer alteration. 669.Tp Cx \&( 670.Ic $ 671.Cx \&) 672.Ic r 673.Cx \&\ \& 674.Ar filename 675.Cx 676The read command 677reads in the given file after the addressed line. 678If no file name is given, 679the remembered file name, if any, is used 680(see 681.Ic e 682and 683.Ic f 684commands). 685The file name is remembered if there was no 686remembered file name already. 687Address `0' is legal for 688.Ic r 689and causes the 690file to be read at the beginning of the buffer. 691If the read is successful, the number of characters 692read is typed. 693.Cx ` 694.Ic \&. 695.Cx \' 696.Cx 697is left at the last line read in from the file. 698.Tp Cx \&( 699.Ic \&. 700.Cx \&, 701.Ic \&. 702.Cx \&) 703.Ic \&s 704.Ar/regular expression/replacement/ 705.Cx \&\tor 706.Cx 707.Tp Cx \&( 708.Ic \&. 709.Cx \&, 710.Ic \&. 711.Cx \&) 712.Ic \&s 713.Ar/regular expression/replacement/ 714.Ic \&g 715.Cx 716The substitute command searches each addressed 717line for an occurrence of the specified regular expression. 718On each line in which a match is found, 719all matched strings are replaced by the replacement specified, 720if the global replacement indicator 721.Ic \&g 722appears after the command. 723If the global indicator does not appear, only the first occurrence 724of the matched string is replaced. 725It is an error for the substitution to fail on all addressed lines. 726Any punctuation character 727may be used instead of 728.Cx ` 729.Ic \&/ 730.Cx \' 731.Cx 732to delimit the regular expression 733and the replacement. 734.Cx ` 735.Ic \&. 736.Cx \' 737.Cx 738is left at the last line substituted. 739An ampersand 740.Cx ` 741.Ic \&& 742.Cx \' 743.Cx 744appearing in the replacement 745is replaced by the string matching the regular expression. 746The special meaning of 747.Cx ` 748.Ic \&& 749.Cx \' 750.Cx 751in this context may be 752suppressed by preceding it by 753.Cx ` 754.Ic \&\e 755.Cx \'. 756.Cx 757The characters 758.Cx ` 759.Ic \&\e 760.Ar n 761.Cx \' 762.Cx 763where 764.Ar n 765is a digit, 766are replaced by the text matched by the 767.Cx Ar n 768.Cx \'th 769.Cx 770regular subexpression 771enclosed between 772.Cx ` 773.Ic \&\e\&( 774.Cx \'. 775.Cx 776and 777.Cx ` 778.Ic \&\e\&) 779.Cx \'. 780.Cx 781When 782nested, parenthesized subexpressions 783are present, 784.Ar n 785is determined by counting occurrences of 786.Cx ` 787.Ic \&\e\&( 788.Cx \'. 789.Cx 790starting from the left. 791Lines may be split by substituting new-line characters into them. 792The new-line in the 793replacement string 794must be escaped by preceding it by 795.Cx ` 796.Ic \&\e 797.Cx \'. 798.Cx 799One or two trailing delimiters may be omitted, 800implying the 801.Ic p 802suffix. 803The special form 804.Ic s 805followed by 806.Ar no 807delimiters 808repeats the most recent substitute command 809on the addressed lines. 810The 811.Ic s 812may be followed by the letters 813.Ic r 814(use the most recent regular expression for the 815left hand side, instead of the most recent 816left hand side of a substitute command), 817.Ic p 818(complement the setting of the 819.Ic p 820suffix from the previous substitution), or 821.Ic g 822(complement the setting of the 823.Ic g 824suffix). 825These letters may be combined in any order. 826.Tp Cx \&( 827.Ic \&. 828.Cx \&, 829.Ic \&. 830.Cx \&) 831.Ic \&t 832.Ar a 833.Cx 834This command acts just like the 835.Ic m 836command, except that a copy of the addressed lines is placed 837after address 838.Ad a 839(which may be 0). 840.Cx ` 841.Ic \&. 842.Cx \' 843.Cx 844is left on the last line of the copy. 845.Tp Cx \&( 846.Ic \&. 847.Cx \&, 848.Ic \&. 849.Cx \&) 850.Ic \&u 851.Cx 852The undo command restores the buffer to it's state 853before the most recent buffer modifying command. 854The current line is also restored. 855Buffer modifying commands are 856.Ic a , c , d , g , i , k , m , r , s , t , 857and 858.Ic v . 859For purposes of undo, 860.Ic g 861and 862.Ic v 863are considered to be a single buffer modifying command. 864Undo is its own inverse. 865When 866.Nm ed 867runs out of memory 868(at about 8000 lines on any 16 bit mini-computer 869such as the PDP-11) 870This full undo is not possible, and 871.Ic u 872can only undo the effect of the most recent 873substitute on the current line. 874This restricted undo also applies to editor scripts 875when 876.Nm ed 877is invoked with the 878.Fl 879option. 880.Tp Cx \&( 881.Ic \&1 882.Cx \&, 883.Ic \&$ 884.Cx \&) 885.Ic \&v 886.Ar/regular expression/command list 887.Cx 888This command is the same as the global command 889.Ic g 890except that the command list is executed 891.Ic g 892with 893.Cx ` 894.Ic \&. 895.Cx \' 896.Cx 897initially set to every line 898.Em except 899those 900matching the regular expression. 901(1, $)\w filename 902.Tp Cx \&( 903.Ic \&1 904.Cx \&, 905.Ic \&$ 906.Cx \&) 907.Ic \&w 908.Cx \&\ \& 909.Ar filename 910.Cx 911The write command writes the addressed lines onto 912the given file. 913If the file does not exist, 914it is created. 915The file name is remembered if there was no 916remembered file name already. 917If no file name is given, 918the remembered file name, if any, is used 919(see 920.Ic e 921and 922.Ic f 923commands). 924.Cx ` 925.Ic \&. 926.Cx \' 927.Cx 928is unchanged. 929If the command is successful, the number of characters written is 930printed. 931.Tp Cx \&( 932.Ic \&1 933.Cx \&, 934.Ic \&$ 935.Cx \&) 936.Ic \&W 937.Cx \&\ \& 938.Ar filename 939.Cx 940This command is the same as 941.Ic w , 942except that the addressed lines are appended to the file. 943.Tp Cx \&( 944.Ic \&1 945.Cx \&, 946.Ic \&$ 947.Cx \&) 948.Ic \&wq 949.Cx \&\ \& 950.Ar filename 951.Cx 952This command is the same as 953.Ic w 954except that afterwards a 955.Ic q 956command is done, 957exiting the editor 958after the file is written. 959.Tp x 960A key string is demanded from the standard input. 961Later 962.Ic r , e 963and 964.Ic w 965commands will encrypt and decrypt the text 966with this key by the algorithm of 967.Xr crypt 1 . 968An explicitly empty key turns off encryption. 969.Ic \&1 970.Ic \&+1 971.Cx \&) 972.Ic \&z 973.Cx \&\ \ \&or, 974.Cx 975.Tp Cx \&( 976.Ic \&1 977.Ic \&+1 978.Cx \&) 979.Ic \&z 980.Ar n 981.Cx 982This command scrolls through the buffer starting at the addressed line. 98322 (or 984.Ar n , 985if given) 986lines are printed. 987The last line printed becomes the current line. 988The value 989.Ar n 990is sticky, in that it becomes the default for 991future 992.Ic z 993commands. 994.Tp Cx \&( 995.Ic \&$ 996.Cx \&) 997.Ic \&= 998.Cx 999The line number of the addressed line is typed. 1000.Cx ` 1001.Ic \&. 1002.Cx \' 1003.Cx 1004is unchanged by this command. 1005.Tp Cx Ic \&! 1006.Cx <shell\ command> 1007.Cx 1008The remainder of the line after the `!' is sent 1009to 1010.Xr sh 1 1011to be interpreted as a command. 1012.Cx ` 1013.Ic \&. 1014.Cx \' 1015.Cx 1016is unchanged. 1017.Tp Cx \&( 1018.Ic \&.+1 1019.Cx \&, 1020.Ic \&.+1 1021.Cx \&) 1022.Cx <newline> 1023.Cx 1024An address alone on a line causes the addressed line to be printed. 1025A blank line alone is equivalent to 1026.Ic .+1 1027it is useful 1028for stepping through text. 1029If two addresses are present with no 1030intervening semicolon, 1031.Nm ed 1032prints the range of lines. 1033If they are separated by a semicolon, 1034the second line is printed. 1035.Tp 1036.Pp 1037If an interrupt signal (ASCII DEL) is sent, 1038.Nm ed 1039prints 1040.Sq Li ?interrupted 1041and returns to its command level. 1042.Pp 1043Some size limitations: 1044512 characters per line, 1045256 characters per global command list, 104664 characters per file name, 1047and, on mini computers, 1048128K characters in the temporary file. 1049The limit on the number of lines depends on the amount of core: 1050each line takes 2 words. 1051.Pp 1052When reading a file, 1053.Nm ed 1054discards ASCII NUL characters 1055and all characters after the last newline. 1056It refuses to read files containing non-ASCII characters. 1057.Sh FILES 1058.Dw edhup 1059.Di L 1060.Dp Pa /tmp/e* 1061.Dp Pa edhup 1062work is saved here if terminal hangs up 1063.Dp 1064.Sh SEE ALSO 1065.Xr ex 1 , 1066.Xr sed 1 , 1067.Xr crypt 1 1068.br 1069B. W. Kernighan, 1070.Em A Tutorial Introduction to the ED Text Editor 1071.br 1072B. W. Kernighan, 1073.Em Ar Advanced editing on UNIX 1074.Sh HISTORY 1075The 1076.Nm ed 1077command appeared in Version 6 AT&T UNIX. 1078.Sh DIAGNOSTICS 1079.Sq Li name 1080for inaccessible file; 1081.Sq Li ?self-explanatory message 1082for other errors. 1083.Pp 1084To protect against throwing away valuable work, 1085a 1086.Ic q 1087or 1088.Ic e 1089command is considered to be in error, unless a 1090.Ic w 1091has occurred since the last buffer change. 1092A second 1093.Ic q 1094or 1095.Ic e 1096will be obeyed regardless. 1097.Sh BUGS 1098The 1099.Ic l 1100command mishandles 1101.Li DEL . 1102.br 1103The 1104.Ic undo 1105command causes marks to be lost on affected lines. 1106.br 1107The 1108.Ic x 1109command, 1110.Fl x 1111option, 1112and 1113special treatment of hangups 1114only work on UNIX. 1115