diff options
author | Ian Darwin <ian@cvs.openbsd.org> | 2010-07-01 02:32:44 +0000 |
---|---|---|
committer | Ian Darwin <ian@cvs.openbsd.org> | 2010-07-01 02:32:44 +0000 |
commit | 45ca25a442bb20327ed354e7d7e41562c1a44bd3 (patch) | |
tree | d9a8046ae9e4128e860932712aa0331999b80bf5 /usr.bin/learn | |
parent | 4716bf471cde28d86c268064b1d84401ca0b7bd1 (diff) |
Remove a long-dead skeleton found under the floorboards.
"go for it" tedu@, "kill it" deraadt@
Diffstat (limited to 'usr.bin/learn')
530 files changed, 0 insertions, 21058 deletions
diff --git a/usr.bin/learn/README b/usr.bin/learn/README deleted file mode 100644 index c5ff5282d02..00000000000 --- a/usr.bin/learn/README +++ /dev/null @@ -1,13 +0,0 @@ -Learn was originally written by Mike Lesk with some contributions -from Brian Kernighan. The paper in this directory dates from the -second version of learn, around 1979. - -This version of learn has been resurrected from the original V7 -source and edited enough that the source compiles and the -lessons can be executed. We have made no attempt to update the -lessons, nor to fix some of the glaring problems with the code. -Think of it as a historical document, not a polished system. - -cd src -make -learn diff --git a/usr.bin/learn/lib/C/L0 b/usr.bin/learn/lib/C/L0 deleted file mode 100644 index bab7601e708..00000000000 --- a/usr.bin/learn/lib/C/L0 +++ /dev/null @@ -1,2 +0,0 @@ -#next -0.1a 10 diff --git a/usr.bin/learn/lib/C/L0.1a b/usr.bin/learn/lib/C/L0.1a deleted file mode 100644 index fc11c29ce9c..00000000000 --- a/usr.bin/learn/lib/C/L0.1a +++ /dev/null @@ -1,23 +0,0 @@ -#print -WARNING: This course was written for C as it was in 1979, not 1999, -and has not yet been updated. Some details may be way out of date! -In particular, there is not yet any updating for ANSI C. - -This script is loosely based on the material in -"The C Programming Language", by Brian Kernighan -and Dennis Ritchie (Prentice-Hall, 1978). -You may find it helpful to have that at hand. -Some of the lessons will indicate -the section that they are based on. - -Do you have a copy at hand? Answer yes or no. -#copyin -#user -#uncopyin -#match yes -Fine. -#fail -It might help, but it's not critical. -#log -#next -1.1a 10 diff --git a/usr.bin/learn/lib/C/L1.1a b/usr.bin/learn/lib/C/L1.1a deleted file mode 100644 index a84b86b9b45..00000000000 --- a/usr.bin/learn/lib/C/L1.1a +++ /dev/null @@ -1,23 +0,0 @@ -#print -(Section 1.1) -The way you compile a C program is to say - cc name.c -where name.c is the name of the file the program -is on. Here is a short C program that prints -out a line containing "hello". Type it in and -compile it. Call it anything you want but -don't rename the output. -When done, type "ready". - -main() -{ - printf("hello\n"); -} -#once #create Ref -hello -#user -a.out >x -#cmp x Ref -#log -#next -1.1b 10 diff --git a/usr.bin/learn/lib/C/L1.1b b/usr.bin/learn/lib/C/L1.1b deleted file mode 100644 index 93798736abb..00000000000 --- a/usr.bin/learn/lib/C/L1.1b +++ /dev/null @@ -1,31 +0,0 @@ -#print -(Section 1.1) -Now write a C program that prints two lines, -the first of which says "hello" and the second -"goodbye". Don't forget those \n delimiters. -Compile and test it. When satisfied, -type "ready". -#once #create Ref -hello -goodbye -#user -a.out >test -#cmp test Ref -#succeed -Here is one possible solution to compare against yours. - -main() -{ - printf("hello\n"); - printf("goodbye\n"); -} - -You could also combine the two messages into one -call to printf, like - - printf("hello\ngoodbye\n"); - -but this is harder to read at a glance. -#log -#next -1.1c 10 diff --git a/usr.bin/learn/lib/C/L1.1c b/usr.bin/learn/lib/C/L1.1c deleted file mode 100644 index 0ec06a30f59..00000000000 --- a/usr.bin/learn/lib/C/L1.1c +++ /dev/null @@ -1,18 +0,0 @@ -#print -(Section 1.1) -The program in Ref.c has an error in it. -Find it, fix it, and run it. -Then type ready. -#once #create Ref.c -main() -{ - printf("hello\"); -} -#once #create Ref -hello -#user -a.out >x -#cmp x Ref -#log -#next -1.1d 10 diff --git a/usr.bin/learn/lib/C/L1.1d b/usr.bin/learn/lib/C/L1.1d deleted file mode 100644 index 1ee669389d0..00000000000 --- a/usr.bin/learn/lib/C/L1.1d +++ /dev/null @@ -1,33 +0,0 @@ -#print -(Section 1.1) -Write a program which prints these four lines, -exactly as shown: -A tab is \t -A backspace is \b -A quote is \" -A backslash is \\ - -Compile it, test it, then type ready. -#once #create Ref -A tab is \t -A backspace is \b -A quote is \" -A backslash is \\ -#user -a.out >x -#cmp x Ref -#succeed -One solution: - -main() -{ - printf("A tab is \\t\n"); - printf("A backspace is \\b\n"); - printf("A quote is \\\"\n"); - printf("A backslash is \\\\\n"); -} -#fail -Watch out for those backslashes. -#log -#next -1.1e 10 diff --git a/usr.bin/learn/lib/C/L1.1e b/usr.bin/learn/lib/C/L1.1e deleted file mode 100644 index 4a067909acb..00000000000 --- a/usr.bin/learn/lib/C/L1.1e +++ /dev/null @@ -1,14 +0,0 @@ -#print -What will be printed by the following printf statement? - - printf("\"#@\""); - -Type "answer XXX", where XXX is the set of characters -that will be printed. -#copyin -#user -#uncopyin -#match "#@" -#log -#next -1.1f 10 diff --git a/usr.bin/learn/lib/C/L1.1f b/usr.bin/learn/lib/C/L1.1f deleted file mode 100644 index b73e575d29b..00000000000 --- a/usr.bin/learn/lib/C/L1.1f +++ /dev/null @@ -1,19 +0,0 @@ -#print -(Section 1.2) -Write a program to print -the value of the character 'X' in -octal. Compile it and run it. -Then type ready. -#user -a.out >test -grep 130 test >/dev/null -#succeed -A possible solution: - -main() -{ - printf("%o\n", 'X'); -} -#log -#next -2.1a 10 diff --git a/usr.bin/learn/lib/C/L10 b/usr.bin/learn/lib/C/L10 deleted file mode 100644 index 7599c4bbccd..00000000000 --- a/usr.bin/learn/lib/C/L10 +++ /dev/null @@ -1,15 +0,0 @@ -#print -The lessons from this point on are from the old C script. -They have not been cleaned up as much as they could, so some -are not very illuminating, and the code they illustrate -is not always the best. You're welcome to try them nonetheless, -but be warned. -If you want to proceed, type yes; -otherwise, type bye. -#copyin -#user -#uncopyin -#match yes -#next -11.1a 10 -11.2a 5 diff --git a/usr.bin/learn/lib/C/L11.1a b/usr.bin/learn/lib/C/L11.1a deleted file mode 100644 index 4473506f65c..00000000000 --- a/usr.bin/learn/lib/C/L11.1a +++ /dev/null @@ -1,35 +0,0 @@ -#print -With your 'cc' command you can give the name of -an object file to be loaded with your program. -For example - cc x.c y.o -will load the previously compiled program 'y' along with -the program 'x' to be compiled now. - -The file "getnum.o" contains a subroutine "getnum" which -reads an integer and returns its value. -Write a program which reads a number and decides -whether or not it is a multiple of 23. If so print -"yes" and otherwise print "no". -Compile and test; then type "ready". -#once #create Ref1 -23000 -#once #create Ref2 -23001 -#once cp %s/getnum.o . -#user -a.out <Ref1 >z1 -a.out <Ref2 >z2 -grep yes z1 >/dev/null && grep no z2 >/dev/null -#succeed -/* One way: */ - -main() { - if (getnum()%23 == 0) - printf("yes\n"); - else - printf("no\n"); -} -#log -#next -12.1a 10 diff --git a/usr.bin/learn/lib/C/L11.2a b/usr.bin/learn/lib/C/L11.2a deleted file mode 100644 index 154493d6890..00000000000 --- a/usr.bin/learn/lib/C/L11.2a +++ /dev/null @@ -1,29 +0,0 @@ -#print -With your 'cc' command you can give the name of -an object file to be loaded with your program. -For example - cc x.c y.o -will load the previously compiled program 'y' along with -the program 'x' to be compiled now. -There is a file in this directory named "getnum.o" -that contains a subroutine "getnum" that will read digits -from the standard input, convert them to binary, and -return an integer value. - -Write a program which reads an integer and prints -it back in octal. Compile and test as usual. -#once #create Ref -254 -#once cp %s/getnum.o . -#user -a.out <Ref >test -grep 376 test >/dev/null -#succeed -/* One way: */ - -main() { - printf("%o\n", getnum()); -} -#log -#next -11.1a 10 diff --git a/usr.bin/learn/lib/C/L12.1a b/usr.bin/learn/lib/C/L12.1a deleted file mode 100644 index ad51d56c842..00000000000 --- a/usr.bin/learn/lib/C/L12.1a +++ /dev/null @@ -1,35 +0,0 @@ -#print -Write a program which reads two numbers and -prints the larger one in decimal. Use the same -"getnum" subroutine. Compile, test and type -"ready" as usual. -#once #create Ref1 -14039 89 -#once #create Ref2 -20022 23001 -#once cp %s/getnum.o . -#user -a.out <Ref1 >x1 -a.out <Ref2 >x2 -grep 14039 x1 >/dev/null && grep 23001 x2 >/dev/null -#succeed -/* One way: */ - -main() { - int n1, n2; - - n1 = getnum(); - n2 = getnum(); - printf("%d\n", n1 > n2 ? n1 : n2); -} - -/* You could also use something like - - if (n1 > n2) - printf("%d\n", n1); - else - printf("%d\n", n2); - */ -#log -#next -12.1b 10 diff --git a/usr.bin/learn/lib/C/L12.1b b/usr.bin/learn/lib/C/L12.1b deleted file mode 100644 index 3f60b51bdec..00000000000 --- a/usr.bin/learn/lib/C/L12.1b +++ /dev/null @@ -1,60 +0,0 @@ -#print -The function getnum actually returns -1 when it -encounters end of file. (The source is in getnum.c -if you're interested.) -Write, compile and run a program that -reads numbers one per line with getnum -and, for each, prints: - -small if the number is >0 and <=100 -big if the number is >100 and <=1000 -huge if the number is >1000. - -Type "ready" when you're done. -#once cp %s/getnum.o . -#once cp %s/getnum.c . -#once #create Ref -1001 -1000 -999 -101 -100 -1 -#once #create Ref1 -huge -big -big -big -small -small -#user -a.out <Ref >test -#cmp Ref1 test -#succeed -/* One way:*/ - -main() { - int n; - - while ((n = getnum()) >= 0) - if (n > 0 && n <= 100) - printf("small\n"); - else if (n > 100 && n <= 1000) - printf("big\n"); - else if (n > 1000) - printf("huge\n"); -} - -/* Notice that in principle n could be negative, - so we need the last case to say - else if (n > 1000) - instead of just falling into it with a bare - else - - Also it's a good idea to indent the else-if's - exactly the way they are here; otherwise - you'll lose track of what's going on. -**/ -#log -#next -13.1a 10 diff --git a/usr.bin/learn/lib/C/L13.1a b/usr.bin/learn/lib/C/L13.1a deleted file mode 100644 index a70bd13fda7..00000000000 --- a/usr.bin/learn/lib/C/L13.1a +++ /dev/null @@ -1,39 +0,0 @@ -#print -Write a program which reads -its input and counts the number of -characters and the number of spaces -(where a space is either a blank or -a tab or a newline). Print both numbers. -Compile, test, and type "ready". -#once #create Ref -hoboken harrison newark roseville avenue grove street -east orange brick church orange highland avenue -mountain station south orange maplewood millburn short hills -summit chatham madison convent station morristown -new providence murray hill berkeley heights -gillette stirling millington lyons basking ridge -bernardsville far hills peapack gladstone -#user -a.out <Ref >x1 -a.out <Ref >x2 -grep 348 x1 >/dev/null && grep 45 x2 >/dev/null -#succeed - #include <stdio.h> -/* One way: */ - -main() { - int nchar, nspace; - char c; - - nchar = nspace = 0; - while ((c = getchar()) != EOF) { - nchar++; - if (c == ' ' || c == '\t' || c == '\n') - nspace++; - } - printf("spaces = %d, chars = %d\n", nspace, nchar); -} -#log -#next -14.1a 10 -14.2a 5 diff --git a/usr.bin/learn/lib/C/L14.1a b/usr.bin/learn/lib/C/L14.1a deleted file mode 100644 index fd3de193d16..00000000000 --- a/usr.bin/learn/lib/C/L14.1a +++ /dev/null @@ -1,38 +0,0 @@ -#print -Using the familar "getnum.o" routine -write a program that reads numbers one per line and determines -for each if it is prime. Print "prime" -for a prime number and "composite" for a non-prime number. -Compile, test, and type "ready". -#once #create Ref -10039 -17947 -#once #create Ref1 -prime -composite -#once cp %s/getnum.o . -#user -a.out <Ref >x1 -#cmp x1 Ref1 -#succeed -/* A slow but sure prime-tester */ -main() -{ - int p, i, comp; - - while ((p = getnum()) >= 0) { - comp = 0; - for (i = 2; i*i <= p; i++) - if (p%i == 0) { - comp = 1; - break; - } - if (comp) - printf("composite\n"); - else - printf("prime\n"); - } -} -#log -#next -15.1a 10 diff --git a/usr.bin/learn/lib/C/L14.2a b/usr.bin/learn/lib/C/L14.2a deleted file mode 100644 index 01cc54f6129..00000000000 --- a/usr.bin/learn/lib/C/L14.2a +++ /dev/null @@ -1,26 +0,0 @@ -#print -Using the "getnum" routine on "getnum.o", write a program -that reads a list of positive numbers and prints their sum. Stop reading -numbers when "getnum" returns a negative or zero value. -Compile and test your program; then type "ready". -#once #create Ref -5 43 293 400 75 832 903 33 -#once cp %s/getnum.o . -#user -a.out <Ref >xxx -grep 2584 xxx >/dev/null -#succeed -/* Read numbers and count */ -main() -{ - int s, n; - - s = 0; - while ((n=getnum()) > 0) - s += n; - printf("Sum is %d\n", s); -} -#log -#next -14.2b 5 -15.1a 10 diff --git a/usr.bin/learn/lib/C/L14.2b b/usr.bin/learn/lib/C/L14.2b deleted file mode 100644 index 66633049b67..00000000000 --- a/usr.bin/learn/lib/C/L14.2b +++ /dev/null @@ -1,41 +0,0 @@ -#print -Write a program which counts the number of five letter -words in its input (define a word as anything between -blanks, tabs or newlines). Compile and run it, then type "ready". -Note that all that is wanted is the total number of -five letter words - nothing was said about distinct -words. Just count the number of times exactly five -characters appear between spaces. -#once #create Ref -This is a passage of text which contains -exactly twelve words of five letters. -Words may appear at the start or at the final -part of a line. Other words show up in -the middle. Avoid counting seven or eight letters -but every five must be noted. -#user -a.out <Ref >xxx -grep 12 xxx >/dev/null -#succeed -/* one way to count five letter words */ - #include <stdio.h> - -main() -{ - int since, wdnum, c; - - since = 0; - while ((c=getchar()) != EOF) { - if (c == ' ' || c == '\t' || c == '\n') { - if (since == 5) - wdnum++; - since = 0; - } - else - since++; - } - printf("%d\n", wdnum); -} -#log -#next -15.1a 10 diff --git a/usr.bin/learn/lib/C/L15.1a b/usr.bin/learn/lib/C/L15.1a deleted file mode 100644 index e1b7a6ec62f..00000000000 --- a/usr.bin/learn/lib/C/L15.1a +++ /dev/null @@ -1,33 +0,0 @@ -#print -Write a program that reads in lines one at a time, -and prints them out if their length (including -the newline) is odd. -You can use the function getline if you like; the object -file is in getline.o. -Compile and run it, then type "ready". -#once #create Ref1 -this line contains an odd number of letters! -this line, however, contains an even number of letters! -#once #create Ref2 -this line contains an odd number of letters! -#once cp %s/getline.o . -#user -a.out <Ref1 >x1 -#cmp x1 Ref2 -#succeed -/* It's certainly easiest with getline: */ - - #include <stdio.h> - -main() -{ - char line[500]; - int n; - - while ((n = getline(line, 500)) > 0) - if (n % 2 == 1) - printf("%s", line); -} -#log -#next -15.1b 10 diff --git a/usr.bin/learn/lib/C/L15.1b b/usr.bin/learn/lib/C/L15.1b deleted file mode 100644 index d0032a8397a..00000000000 --- a/usr.bin/learn/lib/C/L15.1b +++ /dev/null @@ -1,40 +0,0 @@ -#print -Write a program that reads in lines, and prints each out -in reverse order (except that the newline should be -at the end). -Thus the line -cat food -should come out as -doof tac -Compile it and run it, then type "ready". -#once #create Ref1 -This is odd. -This is even. - -#once #create Ref2 -.ddo si sihT -.neve si sihT - -#once cp %s/getline.o . -#user -a.out <Ref1 >x1 -#cmp x1 Ref2 -#succeed -/* one way to do this */ - #include <stdio.h> - -main() -{ - char line[500]; - int n; - - while ((n = getline(line, 500)) > 0) { - for (n -= 2; n >= 0; n--) - putchar(line[n]); - putchar('\n'); - } -} -#log -#next -17.1a 10 -16.2a 5 diff --git a/usr.bin/learn/lib/C/L16.2a b/usr.bin/learn/lib/C/L16.2a deleted file mode 100644 index 7c753d95652..00000000000 --- a/usr.bin/learn/lib/C/L16.2a +++ /dev/null @@ -1,54 +0,0 @@ -#print -Write a program which reads a file with lines of up -to 200 characters and shortens them to 60 characters -by throwing away any characters past the first 60. -Compile and test it; then type "ready". -#once #create Ref -hoboken harrison newark roseville avenue grove street -east orange brick church orange highland avenue east orange -mountain station south orange maplewood millburn short hills -summit chatham madison convent station morristown summit cha -new providence murray hill berkeley heights - -gillette stirling millingon lyons basking ridgexxxxxxxxxxxxx -bernardsville far hills peapack gladstone -#once #create badin -hoboken harrison newark roseville avenue grove street -east orange brick church orange highland avenue east orange brick church orange highland avenue east orange brick church orange highland avenue -mountain station south orange maplewood millburn short hills -summit chatham madison convent station morristown summit chatham madison convent station morristown summit chatham madison convent station morristown -new providence murray hill berkeley heights - -gillette stirling millingon lyons basking ridgexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -bernardsville far hills peapack gladstone -#user -a.out <badin >xxx -#cmp Ref xxx -#succeed -/* one way to do this */ - #include <stdio.h> - -main() -{ - char line[61]; - int c, k; - - k = 0; - while ((c = getchar()) != EOF) { - if (c == '\n') { - line[k] = 0; - printf("%s\n", line); - k = 0; - } - else if (k < 60) - line[k++] = c; - } -} - -/* Note that this version works regardless of -how long the lines are. If you use getline, -is the same thing true?? - */ -#log -#next -16.2b 10 diff --git a/usr.bin/learn/lib/C/L16.2b b/usr.bin/learn/lib/C/L16.2b deleted file mode 100644 index 3d4bf96dfab..00000000000 --- a/usr.bin/learn/lib/C/L16.2b +++ /dev/null @@ -1,40 +0,0 @@ -#print -Write a program which copies all lines containng -the letter 'p' from its input to its output. -Compile and test it; then type "ready". -#once #create Ref -mountain station south orange maplewood millburn short hills -new providence murray hill berkeley heights -bernardsville far hills peapack gladstone -#once #create badin -hoboken harrison newark roseville avenue grove street -east orange brick church orange highland avenue -mountain station south orange maplewood millburn short hills -summit chatham madison convent station morristown -new providence murray hill berkeley heights -gillette stirling millington lyons basking ridge -bernardsville far hills peapack gladstone -#once cp %s/getline.o . -#user -a.out <badin >xxx -#cmp Ref xxx -#succeed -/* a way to find lines with 'p' */ - #include <stdio.h> - -main() -{ - char line[500]; - int k; - - while (getline(line, 500) > 0) - for (k = 0; line[k] != '\0'; k++) - if (line[k] == 'p') { - printf("%s", line); - break; - } -} -#log -#next -16.2c 5 -17.1a 10 diff --git a/usr.bin/learn/lib/C/L16.2c b/usr.bin/learn/lib/C/L16.2c deleted file mode 100644 index b170a71e838..00000000000 --- a/usr.bin/learn/lib/C/L16.2c +++ /dev/null @@ -1,67 +0,0 @@ -#print -Write a program to read its input and find the -word in it with the most vowels (instances of a,e,i,o, or u). -Print out that word. Compile and test your -program, then type ready. -#once #create Ref -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. - We hold these truths to be self evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#user -a.out <Ref >xxx -grep unalienable xxx >/dev/null -#succeed -/* a way to find a word with lots of vowels */ - #include <stdio.h> - -main() -{ - char bigword[100], thisword[100]; - int nvow, maxvow, c, k; - - maxvow = k = 0; - while ((c = getchar()) != EOF) { - if (c == '\n' || c == ' ') { - if (nvow > maxvow) { - copy(thisword, bigword, k); - maxvow = nvow; - } - nvow = k = 0; - } else { - thisword[k++] = c; - switch (c) { - case 'a': case 'e': case 'i': case 'o': case 'u': - nvow++; - } - } - } - printf("the word %s had %d vowels\n", bigword, maxvow); -} - -copy(a, b, n) -char a[], b[]; -{ - int i; - - for(i = 0; i < n; i++) - b[i] = a[i]; - b[i] = 0; -} -#log -#next -17.1a 10 diff --git a/usr.bin/learn/lib/C/L17.1a b/usr.bin/learn/lib/C/L17.1a deleted file mode 100644 index 7c3976cc705..00000000000 --- a/usr.bin/learn/lib/C/L17.1a +++ /dev/null @@ -1,71 +0,0 @@ -#print -Write in a program which reads its input and writes it -out line numbered, with a three-digit line number (starting at one) -followed by a single space and then by the original line. -Note: the printf format specification %3d will print a three -digit number. -You might try the function fgets (part of the standard library). - fgets(buf, size, stdin) -reads from the terminal ("stdin") up to size characters -into buf. It returns NULL on end of file. - -Compile and test your program; then type "ready". -#once #create Ref -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. - We hold these truths to be self evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once #create reffed - 1 When in the course of human events, it becomes - 2 necessary for one people to dissolve the political bands which have - 3 connected them with another, and to assume among the - 4 powers of the earth the separate and equal station to which - 5 the laws of Nature and of Nature's God entitle them, a decent - 6 respect to the opinions of mankind requires that they should - 7 declare the causes which impel them to the separation. - 8 We hold these truths to be self evident, that all men - 9 are created equal, that they are endowed by their creator - 10 with certain unalienable rights, that among these are life, liberty, - 11 and the pursuit of happiness. That to secure these rights, - 12 governments are instituted among men, deriving their just - 13 powers from the consent of the governed. That whenever - 14 any form of government becomes destructive of these ends, - 15 it is the right of the people to alter or to abolish it, and - 16 to institute new government, laying its foundation on such - 17 principles and organizing its powers in such form, as to them - 18 shall seem most likely to effect their safety and happiness. -#user -a.out <Ref >xxx -#cmp xxx reffed -#succeed - - - #include <stdio.h> - -main() -{ - char s[200]; - int k; - - k = 0; - while (fgets(s, 200, stdin) != NULL) - printf("%3d %s", ++k, s); -} -#log -#next -18.1a 10 -17.1c 5 diff --git a/usr.bin/learn/lib/C/L17.1c b/usr.bin/learn/lib/C/L17.1c deleted file mode 100644 index c7eb76ce64b..00000000000 --- a/usr.bin/learn/lib/C/L17.1c +++ /dev/null @@ -1,50 +0,0 @@ -#print -Print the 20 Fibonacci numbers beginning with 2 -(the sequence is 2,3,5,8,... where each number -is the sum of the immediately preceding pair of numbers. -Start with the pair 1,1). -Print each number on a separate line as a five digit -number (remember %3d in printf? %5d does five digits). -Compile and test your program; then type "ready". -#once #create Ref - 2 - 3 - 5 - 8 - 13 - 21 - 34 - 55 - 89 - 144 - 233 - 377 - 610 - 987 - 1597 - 2584 - 4181 - 6765 -10946 -17711 -#user -a.out >xxx -#cmp xxx Ref -#succeed -/* one way */ -main() -{ - int f1, f2, t, count; - - f1 = 1; - f2 = 1; - for (count = 0; count < 20; count++) { - t = f1+f2; - f1 = f2; - f2 = t; - printf("%5d\n", t); - } -} -#log -#next -18.1a 10 diff --git a/usr.bin/learn/lib/C/L18.1a b/usr.bin/learn/lib/C/L18.1a deleted file mode 100644 index 89a9150f060..00000000000 --- a/usr.bin/learn/lib/C/L18.1a +++ /dev/null @@ -1,49 +0,0 @@ -#print -There is nothing to force you to write a main program -on each file; just as I supplied "getnum" on a separate file, -you can put different routines on different files. Write -a function "length(s)" which if given a character array argument -"s" returns the length of that string. -Put this on a file named "length.c", and leave -the object file in "length.o". -Write the main program for -testing this somewhere else. Type "ready" when you have compiled -and tested your program and are happy with it. -#once #create Ref -This file contains several lines of quite different lengths. - -You should get -all of them exactly -r -right. -#once #create answer -60 -0 -14 -19 -1 -6 -#once #create tzaqc.c -main() { - char s[200]; - while (gets(s)) - printf("%d\n", length(s)); -} -#user -cc tzaqc.c length.c -a.out <Ref >value -#cmp value answer -#succeed -/* one way */ -length(s) -char *s; -{ - int k; - - for (k=0; s[k]; k++) - ; - return(k); -} -#log -#next -19.1a 10 diff --git a/usr.bin/learn/lib/C/L19.1a b/usr.bin/learn/lib/C/L19.1a deleted file mode 100644 index 21e46af064b..00000000000 --- a/usr.bin/learn/lib/C/L19.1a +++ /dev/null @@ -1,29 +0,0 @@ -#print -Write a subroutine which counts the number of times it has -been called and returns that count each time. Name it -"count()". Write it on a file named "count.c". Compile -and test it; type "ready" when happy. -#once #create Ref -23080 -#once #create tzaqc.c -main() { - int i; - for (i = 0; i < 23079; i++) - count(); - printf("%d\n", count()); -} -#user -cc tzaqc.c count.o -a.out >value -#cmp value Ref -#succeed -/* one way */ -count() -{ - static int n = 0; - return(++n); -} -#log -#next -30.1a 10 -20.1a 5 diff --git a/usr.bin/learn/lib/C/L2.1a b/usr.bin/learn/lib/C/L2.1a deleted file mode 100644 index 43e3bafa150..00000000000 --- a/usr.bin/learn/lib/C/L2.1a +++ /dev/null @@ -1,55 +0,0 @@ -#print -(Section 1.2) -The file Ref.c contains a copy of -a program to convert Fahrenheit to -Celsius. Modify it to print this -heading at the top: -Fahrenheit-Celsius Conversion - F: C: -Type ready when you're satisfied. -#once #create Ref -Fahrenheit-Celsius Conversion - F: C: - 0 -17.8 - 20 -6.7 - 40 4.4 - 60 15.6 - 80 26.7 - 100 37.8 - 120 48.9 - 140 60.0 - 160 71.1 - 180 82.2 - 200 93.3 - 220 104.4 - 240 115.6 - 260 126.7 - 280 137.8 - 300 148.9 -#once #create Ref.c -/* print Fahrenheit-Celsius table - for f = 0, 20, ..., 300 */ -main() -{ - int lower, upper, step; - float fahr, celsius; - - lower = 0; /* lower limit of temperature table */ - upper = 300; /* upper limit */ - step = 20; /* step size */ - - fahr = lower; - while (fahr <= upper) { - celsius = (5.0/9.0) * (fahr-32.0); - printf("%4.0f %6.1f\n", fahr, celsius); - fahr = fahr + step; - } -} -#user -a.out >x -#cmp Ref x -#fail -Make sure you get the spacing right. -#log -#next -2.1b 10 diff --git a/usr.bin/learn/lib/C/L2.1b b/usr.bin/learn/lib/C/L2.1b deleted file mode 100644 index efc9a0e7157..00000000000 --- a/usr.bin/learn/lib/C/L2.1b +++ /dev/null @@ -1,21 +0,0 @@ -#print -(Section 1.2) -Write a C program that prints a number which is -the sum of three numbers: 23, 197, and the product -of 23 and 197. Again, compile and test -it. Please do the computation with the program - -if you do it by hand, I'll give you credit for the -work, but it's just stupid. -#user -a.out >test -grep 4751 test >/dev/null -#succeed -/* Here is one possible solution */ - -main() -{ - printf("%d\n", 23 + 197 + 23*197); -} -#log -#next -2.1c 10 diff --git a/usr.bin/learn/lib/C/L2.1c b/usr.bin/learn/lib/C/L2.1c deleted file mode 100644 index 4158208bb59..00000000000 --- a/usr.bin/learn/lib/C/L2.1c +++ /dev/null @@ -1,16 +0,0 @@ -#print -(Section 1.2) -What value is printed by this printf statement? - - printf("%.3f", 3.141592654); - -Type "answer XXX", where XXX is the value. -#copyin -#user -#uncopyin -#match 3.142 -#fail -Remember about rounding? -#log -#next -2.1d 10 diff --git a/usr.bin/learn/lib/C/L2.1d b/usr.bin/learn/lib/C/L2.1d deleted file mode 100644 index 94f328efd30..00000000000 --- a/usr.bin/learn/lib/C/L2.1d +++ /dev/null @@ -1,15 +0,0 @@ -#print -What value is printed by this printf statement? - - printf("%%3.1f", 3.141592654); - -Type "answer XXX", where XXX is the value. -#copyin -#user -#uncopyin -#match %3.1f -#fail -Look again - it's %% -#log -#next -2.1e 10 diff --git a/usr.bin/learn/lib/C/L2.1e b/usr.bin/learn/lib/C/L2.1e deleted file mode 100644 index 86df6328efd..00000000000 --- a/usr.bin/learn/lib/C/L2.1e +++ /dev/null @@ -1,19 +0,0 @@ -#print -Is there any difference between - - printf("%s", s); - -and - - printf(s); - -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#fail -Consider the string "50% of the answers are wrong." -#log -#next -3.1a 10 diff --git a/usr.bin/learn/lib/C/L20.1a b/usr.bin/learn/lib/C/L20.1a deleted file mode 100644 index 0d2d5d11a95..00000000000 --- a/usr.bin/learn/lib/C/L20.1a +++ /dev/null @@ -1,105 +0,0 @@ -#print -Write a program to read a list of positive numbers -and sort them into ascending order. Print -the sorted list of numbers one per line -as five digit numbers (%5d in printf). -Stop reading numbers when getnum returns -1. -Compile and test your program; then type "ready". -#once #create Ref - 1 - 3 - 4 - 9 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 20 - 34 - 71 - 200 - 225 - 250 - 275 - 300 - 4095 - 7111 -16384 -#once cp %s/getnum.o . -#once #create input -4 20 3 200 16384 4095 71 11 12 13 14 -15 16 17 34 9 7111 300 275 250 225 1 -#user -a.out <input >xxx -#cmp xxx Ref -#succeed -main() -{ - int n; - int list[1000]; - - n = getlist(list); - shellsort(list, n); - printlist(list, n); -} - -getlist(list) -int list[]; -{ - int n; - - n = 0; - while ((list[n]=getnum()) >= 0) - n++; - return(n); -} - -/* this is a shell sort, stripped down to process a list - of integers only. Although you probably don't know - how to write this offhand, you should know where to find - it - it is only marginally more code than a bubble sort - and much faster (n**1.5 vs. n**2) in time. */ -shellsort(v, n) /* sort v[0]...v[n-1] into increasing order */ -int v[], n; -{ - int gap, i, j, temp; - - for (gap = n/2; gap > 0; gap /= 2) - for (i = gap; i < n; i++) - for (j=i-gap; j>=0 && v[j]>v[j+gap]; j-=gap) { - temp = v[j]; - v[j] = v[j+gap]; - v[j+gap] = temp; - } -} - -printlist(list, n) -int list[], n; -{ - int i; - for(i=0; i<n; i++) - printf("%5d\n",list[i]); -} -/* this is a crummy bubble sort which - would work perfectly well for this - problem but can not be recommended - for large jobs. -sortlist() -{ - int i, j, k; - - for(i=0; i<n; i++) - for(j=n-1; j>0; j--) - if (list[j-1] > list[j]) { - k = list[j]; - list[j] = list[j-1]; - list[j-1] = k; - } -} - ****/ -#log -#next -30.1a 10 diff --git a/usr.bin/learn/lib/C/L3.1a b/usr.bin/learn/lib/C/L3.1a deleted file mode 100644 index 9efe184ac7c..00000000000 --- a/usr.bin/learn/lib/C/L3.1a +++ /dev/null @@ -1,56 +0,0 @@ -#print -(Section 1.3) -The file Ref.c contains a copy of -a program to convert Fahrenheit to -Celsius that prints from 0 to 300 -degrees in steps of 20. -Modify it to print from 300 down to 0 -in steps of 50. Type ready when you're done. -#once #create Ref - 300 148.9 - 250 121.1 - 200 93.3 - 150 65.6 - 100 37.8 - 50 10.0 - 0 -17.8 -#once #create Ref.c -/* print Fahrenheit-Celsius table - for f = 0, 20, ..., 300 */ -main() -{ - int lower, upper, step; - float fahr, celsius; - - lower = 0; /* lower limit of temperature table */ - upper = 300; /* upper limit */ - step = 20; /* step size */ - - fahr = lower; - while (fahr <= upper) { - celsius = (5.0/9.0) * (fahr-32.0); - printf("%4.0f %6.1f\n", fahr, celsius); - fahr = fahr + step; - } -} -#user -a.out >x -#cmp Ref x -#succeed -Here's our solution: - -main() /* Fahrenheit-Celsius 300 ... 0 by 50 */ -{ - int lower, upper, step; - float fahr; - - lower = 0; /* lower limit of temperature table */ - upper = 300; /* upper limit */ - step = 50; /* step size */ - - for (fahr = upper; fahr >= lower; fahr = fahr - step) - printf("%4.0f %6.1f\n", fahr, (5.0/9.0) * (fahr-32.0)); -} -#log -#next -3.1b 10 diff --git a/usr.bin/learn/lib/C/L3.1b b/usr.bin/learn/lib/C/L3.1b deleted file mode 100644 index 33823309455..00000000000 --- a/usr.bin/learn/lib/C/L3.1b +++ /dev/null @@ -1,14 +0,0 @@ -#print -What is the value of i after this -___for statement executes? -Type "answer N", where N is the value of i. - - for (i = 0; i < 10; i = i + 3) - ; -#copyin -#user -#uncopyin -#match 12 -#log -#next -4.1a 10 diff --git a/usr.bin/learn/lib/C/L30.1a b/usr.bin/learn/lib/C/L30.1a deleted file mode 100644 index 6a70af3612f..00000000000 --- a/usr.bin/learn/lib/C/L30.1a +++ /dev/null @@ -1,45 +0,0 @@ -#print -Write a subroutine named "locn(s,c)" which expects two -arguments: the first is a pointer to characters 's' which -points to a null-terminated string, and the second -is a character 'c' which is to be searched for in the -string 's'. If the character 'c' does not -appear in the string return 0; otherwise return a pointer -to the position of 'c' in the string. Name the program "locn.c"; -as usual, compile and test it and then type "ready". -#once #create Ref -0 -19 -0 -25 -0 -#once #create tzaqc.c -char *alpha "abcdefghijklmnopqrstuvwxyz"; -main() -{ - extern char *locn(); - printf("%d\n", locn(alpha, '+')); - printf("%d\n",locn(alpha, 't')-alpha); - printf("%d\n",locn(alpha, 'a')-alpha); - printf("%d\n",locn(alpha, 'z')-alpha); - printf("%d\n",locn("", 'z')); -} -#user -cc tzaqc.c locn.o -a.out >value -#cmp value Ref -#succeed -/* Try this: */ - -char * -locn (s, c) -char *s; -{ - for( ; *s; s++) - if (*s == c) - return(s); - return(0); -} -#log -#next -31.1a 10 diff --git a/usr.bin/learn/lib/C/L31.1a b/usr.bin/learn/lib/C/L31.1a deleted file mode 100644 index 81d1bf9313b..00000000000 --- a/usr.bin/learn/lib/C/L31.1a +++ /dev/null @@ -1,48 +0,0 @@ -#print -Write a function named "rev(s)" which reverses -the string "s" in place. Name the file that contains -the function "rev.c". -When you're satisfied, type "ready". -#once #create Ref -cbax0987654321 -#once #create tzaqc.c -main(){ - char *s1, *s2, *s3, *s4; - s1 = "abc"; - s2 = "x"; - s3 = ""; - s4 = "1234567890"; - rev(s1); - rev(s2); - rev(s3); - rev(s4); - printf(s1); - printf(s2); - printf(s3); - printf(s4); - printf("\n"); -} -#user -cc tzaqc.c rev.o -a.out >value -#cmp value Ref -#succeed -/* One way:*/ - -rev (s) -char *s; -{ - char *p; - int t; - - for (p=s; *p; p++) - ; - for (p--; p > s; p--, s++) { - t = *p; - *p = *s; - *s = t; - } -} -#log -#next -32.1a 10 diff --git a/usr.bin/learn/lib/C/L32.1a b/usr.bin/learn/lib/C/L32.1a deleted file mode 100644 index 7352cd7e9f5..00000000000 --- a/usr.bin/learn/lib/C/L32.1a +++ /dev/null @@ -1,50 +0,0 @@ -#print -Write a program - pair(a,b) -which accepts as arguments two pointers to integers -and swaps the integers if necessary so that the -first argument points to the larger one; that is - int x,y; - x = 9; - y = 15; - pair( &x, &y); -results in x being 15 and y 9. Leave the program -on file "pair.c"; compile, test it, and type "ready". -#once #create tzaqc.c -main() -{ - int x,y; - - y=200; - x = 0; - pair(&y, &x); - if (x != 0 || y != 200) - return(1); - pair(&x,&y); - if (x != 200 || y != 0) - return(1); - x = 30; - y = 23097; - pair(&x,&y); - if (x != 23097 || y != 30) - return(1); - return(0); -} -#user -cc tzaqc.c pair.o -a.out -#succeed -pair(a, b) -int *a, *b; -{ - int t; - - if (*a <= *b) { - t = *a; - *a = *b; - *b = t; - } -} -#log -#next -33.1a 10 diff --git a/usr.bin/learn/lib/C/L33.1a b/usr.bin/learn/lib/C/L33.1a deleted file mode 100644 index e421f55eb7c..00000000000 --- a/usr.bin/learn/lib/C/L33.1a +++ /dev/null @@ -1,23 +0,0 @@ -#print -Write a main program which counts the number of command-line arguments -it has which begin with the letter 'b'. Print the -result in decimal. Compile and test it as usual. -Then type "ready". -#user -a.out abc bcd efg rpq b bbvd >xxx -grep 3 xxx >/dev/null -#succeed -/* a possible solution */ -main(argc, argv) -char *argv[]; -{ - int i, k; - - for(i=k=0; i<argc; i++) - if (argv[i][0] == 'b') - k++; - printf("%d\n", k); -} -#log -#next -37.1a 10 diff --git a/usr.bin/learn/lib/C/L35.1a b/usr.bin/learn/lib/C/L35.1a deleted file mode 100644 index c6f7c0d87b4..00000000000 --- a/usr.bin/learn/lib/C/L35.1a +++ /dev/null @@ -1,35 +0,0 @@ -#print -Write a program which prints the number of vowels -(instances of 'a', 'e', 'i', 'o', and 'u') -in the input. -#once #create Ref -hoboken harrison newark roseville avenue grove street -east orange brick church orange highland avenue -mountain station south orange maplewood millburn short hills -summit chatham madison convent station morristown -new providence murray hill berkeley heights -gillette stirling millington lyons basking ridge -bernardsville far hills peapack gladstone -#user -a.out <Ref >xxx -grep 109 xxx >/dev/null -#succeed -/* a possible solution */ - #include <stdio.h> - -main() -{ - int k, c; - - k = 0; - while ((c = getchar()) != EOF) - switch (c) { - case 'a': case 'e':case 'i': case 'o': case 'u': - k++; - break; - } - printf("%d\n", k); -} -#log -#next -37.1a 10 diff --git a/usr.bin/learn/lib/C/L37.1a b/usr.bin/learn/lib/C/L37.1a deleted file mode 100644 index 55a3e4c5130..00000000000 --- a/usr.bin/learn/lib/C/L37.1a +++ /dev/null @@ -1,57 +0,0 @@ -#print -Let's try a recursive function. Write a subroutine - power(x,n) -which computes x to the power n by the following -algorithm: - 1. if n is zero return 1. - 2. if n is odd return x*power(x,n-1). - 3. if n is even return the square of - power(x,n/2). -You may assume than x and n are integers, n>=0. -If n is negative return 0 for an answer. -Put your routine on a file "power.c". Compile -it and test it; then type "ready". -#once #create tzaqc.c -main() -{ -if (power(-1,-1) != 0) - return(1); - if (power(-3,2) != 9) - return(1); - if (power(2,12) != 4096) - return(1); - if (power(3,5) != 243) - return(1); - if (power(-5, 5) != -3125) - return(1); - if (power(7,3) != 343) - return(1); - if (power(7,4) != 2401) - return(1); - if (power(3,7) != 2187) - return(1); - if (power(2,10) != 1024) - return(1); - return(0); -} -#user -cc tzaqc.c power.o -a.out -#succeed -/* a possible solution */ -power(x, n) -{ - int k; - - if (n < 0) - return(0); - if (n == 0) - return(1); - if (n%2 == 1) - return(x * power(x, n-1)); - k = power(x, n/2); - return(k*k); -} -#log -#next -40.1a 10 diff --git a/usr.bin/learn/lib/C/L4.1a b/usr.bin/learn/lib/C/L4.1a deleted file mode 100644 index e24f87438bc..00000000000 --- a/usr.bin/learn/lib/C/L4.1a +++ /dev/null @@ -1,10 +0,0 @@ -#print -Does the # of a "#define" statement absolutely -have to go in column 1? Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -5.1a 10 diff --git a/usr.bin/learn/lib/C/L40.1a b/usr.bin/learn/lib/C/L40.1a deleted file mode 100644 index a5d67001df4..00000000000 --- a/usr.bin/learn/lib/C/L40.1a +++ /dev/null @@ -1,56 +0,0 @@ -#print -Write a subroutine - errmess(n) -which looks at its argument and prints -one of the following messages: - n message (follow it by a newline) - 1 ? - 2 syntax error - 3 bad syntax error - 4 fatal error - 5 I give up. -anything else eh? -Leave the routine on errmess.c, compiled and tested -as usual. Then type "ready". -#once #create Ref -eh? -eh? -I give up. -fatal error -bad syntax error -syntax error -? -#once #create tzaqc.c -main() -{ - errmess (23069); - errmess (-2000); - errmess (5); - errmess (4); - errmess (3); - errmess (2); - errmess (1); -} -#user -cc tzaqc.c errmess.o -a.out >xxx -#cmp Ref xxx -#succeed -/* a possible solution */ -char *message[] = { - "eh?", - "?", - "syntax error", - "bad syntax error", - "fatal error", - "I give up.", - }; -errmess(n) -{ - if (n < 0 || n > 5) - n = 0; - printf("%s\n", message[n]); -} -#log -#next -41.1a 10 diff --git a/usr.bin/learn/lib/C/L41.1a b/usr.bin/learn/lib/C/L41.1a deleted file mode 100644 index bb85ecd59f1..00000000000 --- a/usr.bin/learn/lib/C/L41.1a +++ /dev/null @@ -1,67 +0,0 @@ -#print -The problem is to produce a function - bitct(x) -which examines the bits in x, returning a count of -the number of 1-bits. There are various ways of doing -this job: here are two. -(1) a sane way. Shift the word x right 16 times (you are -on UNIX) and check the rightmost bit each time, counting -the number of times it is '1'. -(2) a machine-independent (sort of) way. The logical -bitwise AND of x and x-1 contains one fewer one bit than x itself. -Loop anding x and x-1 until you get zero. -Program either algorithm. Compile and test it. Leave it on -a file bitct.c and type "ready". -#once #create tzaqc.c -main() -{ - int x; - x=23069; - if (bitct(x) != goodct(x)) - return(1); - x=0; - if (bitct(x) != goodct(x)) - return(1); - x=16384; - if (bitct(x) != goodct(x)) - return(1); - x = -1; - if (bitct(x) != goodct(x)) - return(1); - x= -200; - if (bitct(x) != goodct(x)) - return(1); - return(0); -} -goodct(x) -{ - int k, i; - for(k=i=0; i<16; i++) - { - k =+ (x&1); - x= x>>1; - } - return(k); -} -#user -cc tzaqc.c bitct.o -a.out -#succeed -/* a possible solution */ -bitct(x) -{ - int k, i; - - for(i=k=0; i<16; i++) { - if (x&1) - k++; - x >>= 1; - } - return(k); -} -/* by the way, if you really care about -this problem a table lookup by whole bytes -is faster */ -#log -#next -42.1a 10 diff --git a/usr.bin/learn/lib/C/L42.1a b/usr.bin/learn/lib/C/L42.1a deleted file mode 100644 index e5323840a9d..00000000000 --- a/usr.bin/learn/lib/C/L42.1a +++ /dev/null @@ -1,57 +0,0 @@ -#print -Write a function - inprod(a,b,n) -that computes the inner product of two integer vectors -a and b which are n items long. Name the file "inprod.c" -and compile and test it; then type ready. -You may assume that the result and all intermediate -values fit in a 16-bit integer, not usually a safe assumption. -#once #create tzaqc.c -main() -{ - int x[100], y[100]; - int k; - for(k=0; k<100; k++) - { - x[k] = k%10; - y[k] = (k*k)%3; - } - if (inprod(x,y,100) != xprod(x,y,100)) return(1); - return(0); -} -xprod(x,y,n) - int *x, *y; -{ - int k, sum; - for(sum=k=0; k<n; k++) - sum=+ *x++ * *y++; - return(sum); -} -#user -cc tzaqc.c inprod.o -a.out -#succeed -/* one way */ -inprod(a, b, n) -int *a, *b; -{ - int s; - - s = 0; - while (n--) - s += *a++ * *b++; - -/* none of the spaces in the line above are necessary but - would you really want to read - s+=*a++**b++; - and try to parse it? Even clearer than what I have, - but slower, would be - for(i=0; i<n; i++) - s += a[i]*b[i]; -*/ - - return(s); -} -#log -#next -43.1a 10 diff --git a/usr.bin/learn/lib/C/L43.1a b/usr.bin/learn/lib/C/L43.1a deleted file mode 100644 index cd62075a88c..00000000000 --- a/usr.bin/learn/lib/C/L43.1a +++ /dev/null @@ -1,70 +0,0 @@ -#print -Write a function - cubrt(x) -that returns the cube root of a floating point number. -Put it on a file named "cubrt.c"; compile and test it, -then type "ready". -(If you don't know how to compute cube roots, try Newton's method). -#once #create reldif.c -double reldif(a,b) - double a,b; -{ -double c,d; -if (a==0. && b==0.) return(0.); -c = a>0 ? a : -a; -d = b>0 ? b : -b; -c = c>d ? c : d; -return( (a-b)/c ); -} -#once #create tzaqc.c -main() -{ - double cubrt(); - double reldif(); - double a, b, eps; - - a = 8.; - b = 2.; - eps = 1e-5; - if (reldif(cubrt(a), b) > eps) - exit(1); - - a = 0.; - b = 0.; - if (reldif(cubrt(a), b) > eps) - exit(1); - - a = 1e6; - b = 1e2; - if (reldif(cubrt(a), b) > eps) - exit(1); - exit(0); -} -#user -cc tzaqc.c cubrt.o reldif.c -a.out -#succeed -/* one way */ -double cubrt(x) -double x; -{ - /* Newton's method: x <- x - (x**3-a)/(3*x*x) */ - double y, yn, dabs(); - y = 0.; - yn = x; - while (dabs(y-yn) > y*1.e-8) { - y = yn; - yn = y - (y*y*y-x)/(3*y*y); - } - return(yn); -} - -double dabs(x) -double x; -{ - return(x>0 ? x : -x); -} -#log -#next -50.1a 10 -43.1b 5 diff --git a/usr.bin/learn/lib/C/L43.1b b/usr.bin/learn/lib/C/L43.1b deleted file mode 100644 index 85f89612dd4..00000000000 --- a/usr.bin/learn/lib/C/L43.1b +++ /dev/null @@ -1,67 +0,0 @@ -#print -Write a subroutine myexp(x) which expects a floating -argument x and returns the floating point value -of e to the x. An adequate algorithm -for the purpose is the standard Maclaurin series - - x 2 3 4 - e = 1 + x + x /2! + x /3! + x /4! + ... -Name your routine myexp(), not exp(). You can test it, then, -by comparing it with the system routine as well as by -comparing it with tables. Leave it on file -myexp.c, and then type "ready". -#once #create reldif.c -double reldif(a,b) - double a,b; -{ -double c,d; -if (a==0. && b==0.) return(0.); -c = a>0 ? a : -a; -d = b>0 ? b : -b; -c = c>d ? c : d; -return( (a-b)/c ); -} -#once #create tzaqc.c -main() -{ -double x,y, log(), myexp(), reldif(); -for(x=1.; x<5.; x=+ 0.2) - { - y = myexp(x); - if (reldif(x, log(y)) >1.e-5) return(1); - } -return(0); -} -exp() -{ -printf("Cheat! you called the system routine\n"); -return(1.2); -} -#user -cc tzaqc.c myexp.o reldif.c -a.out -#succeed -/* one way */ -double myexp(x) -double x; -{ - double term, sum, dabs(); - int n; - - term = sum = 1.0; - n = 1; - while (dabs(term) > dabs(sum)/1.e8) { - term = term * x / n++; - sum += term; - } - return(sum); -} - -double dabs(x) -double x; -{ - return(x>0 ? x : -x); -} -#log -#next -50.1a 10 diff --git a/usr.bin/learn/lib/C/L5.1a b/usr.bin/learn/lib/C/L5.1a deleted file mode 100644 index 9fcae1cb08e..00000000000 --- a/usr.bin/learn/lib/C/L5.1a +++ /dev/null @@ -1,26 +0,0 @@ -#print -(Section 1.5) -Write a program that copies exactly three characters -from its input to its output. -When compiled and tested, type ready. -#once #create Ref -XY -#once #create z1 -XY -marks the spot. -#user -a.out <z1 >z2 -#cmp z2 Ref -#succeed -/* Here is one possible solution */ - -main() -{ - putchar(getchar()); - putchar(getchar()); - putchar(getchar()); -} -#log -#next -5.1b 10 -5.2a 5 diff --git a/usr.bin/learn/lib/C/L5.1b b/usr.bin/learn/lib/C/L5.1b deleted file mode 100644 index e6954bfa915..00000000000 --- a/usr.bin/learn/lib/C/L5.1b +++ /dev/null @@ -1,25 +0,0 @@ -#print -(Section 1.5) -Write a program that will read the first character -from its input and print it out in octal. -Compile it, test it, and then type ready. -#once #create Ref -+ -#user -a.out <Ref >test -grep 53 test >/dev/null -#succeed -A possible solution: - -main() -{ - printf("%o\n", getchar()); -} - - Remember that you can use a function value almost - any place that you could use a variable like x. - Thus many times there's no need for extra variables. -#log -#next -5.1c 10 -5.2b 5 diff --git a/usr.bin/learn/lib/C/L5.1c b/usr.bin/learn/lib/C/L5.1c deleted file mode 100644 index 44c3f59060c..00000000000 --- a/usr.bin/learn/lib/C/L5.1c +++ /dev/null @@ -1,31 +0,0 @@ -#print -(Section 1.5) -Write a program which reads one character from -its input; if that character is ? it prints "yes", -otherwise it prints "no". -Compile it, test it, and then type ready. -#once #create Ref1 -? is here -#once #create Ref2 -no ? at beginning -#user -a.out <Ref1 >test1 -a.out <Ref2 >test2 -grep yes test1 >/dev/null && grep no test2 >/dev/null -#succeed -This is one possible solution - -main() -{ - if (getchar() == '?') - printf("yes\n"); - else - printf("no\n"); -} - -The indenting and general formatting of C programs -should be done so you make the structure clear, -like the code above. -#log -#next -5.1d 10 diff --git a/usr.bin/learn/lib/C/L5.1d b/usr.bin/learn/lib/C/L5.1d deleted file mode 100644 index bfa7289a452..00000000000 --- a/usr.bin/learn/lib/C/L5.1d +++ /dev/null @@ -1,48 +0,0 @@ -#print -Write a program that counts the blanks, tabs, and newlines -in its input, and prints the total. Don't forget to -define the value of EOF at the beginning of your program. -The best way is to add - - #include <stdio.h> - -as the first line of your program. -The must____ be in column 1. -(See page 143 of the C book.) -You may also have to say - -cc name.c -lS - -to compile the program. -#once #create Ref -This is some junk that -contains - blanks - tabs - and newlines. -#user -a.out <Ref >test1 -a.out </dev/null >test2 -grep 13 test1 >/dev/null && grep 0 test2 >/dev/null -#succeed -One possible solution: - - #include <stdio.h> - -main() -{ - int n, c; - - n = 0; - while ((c = getchar()) != EOF) - if (c == ' ' || c == '\t' || c == '\n') - n++; - printf("%d\n", n); -} - -This program won't work on huge files, because an int -isn't big enough. -#log -#next -5.1e 10 -5.2e 5 diff --git a/usr.bin/learn/lib/C/L5.1e b/usr.bin/learn/lib/C/L5.1e deleted file mode 100644 index 47b100a83f6..00000000000 --- a/usr.bin/learn/lib/C/L5.1e +++ /dev/null @@ -1,31 +0,0 @@ -#print -Write a program that counts the number of vowels -in its input (excluding 'y'). Don't forget to define -the value of EOF at the beginning of your program. -#once #create Ref -This line contains some vowels, including -the letter 'y'. It also has a capital letter, I think. -#user -a.out <Ref >test -grep 28 test >/dev/null -#succeed -Here is one solution. - - #include <stdio.h> - -main() -{ - int nv, c; - - nv = 0; - while ((c = getchar()) != EOF) - if (c=='a' || c=='e' || c=='i' || c=='o' || c=='u' - || c=='A' || c=='E' || c=='I' || c=='O' || c=='U') - nv++; - printf("%d\n", nv); -} -#fail -Did you remember capital letters? -#log -#next -5.1f 10 diff --git a/usr.bin/learn/lib/C/L5.1f b/usr.bin/learn/lib/C/L5.1f deleted file mode 100644 index 7ca40a0a7ca..00000000000 --- a/usr.bin/learn/lib/C/L5.1f +++ /dev/null @@ -1,17 +0,0 @@ -#print -(Section 1.5) -Write a program to replace each tab by the -three-character sequence >, backspace, -, -which prints as ->. The program should also replace -each backspace by the analogous sequence <-. -Compile it, test it, then type ready. -#once #create Ref -This contain s a back space and a tab. -#once #create Ref1 -This contain <-s a back <-space and a>-tab. -#user -a.out <Ref >test -#cmp test Ref1 -#log -#next -5.1g 10 diff --git a/usr.bin/learn/lib/C/L5.1g b/usr.bin/learn/lib/C/L5.1g deleted file mode 100644 index 73ea4994661..00000000000 --- a/usr.bin/learn/lib/C/L5.1g +++ /dev/null @@ -1,38 +0,0 @@ -#print -Write a program to copy its input to its output, -replacing each string of one or more blanks by -a single blank. -#once #create Ref - This has lines with several blanks -including some in funny places. -#once #create Ref1 - -#once #create Answer - This has lines with several blanks -including some in funny places. - -#user -a.out <Ref >test -a.out <Ref1 >>test -#cmp test Answer -#succeed -One way: - - #include <stdio.h> - -main() -{ - int c; - - for (c = getchar(); c != EOF; ) { - putchar(c); - if (c == ' ') - while ((c = getchar()) == ' ') - ; - else - c = getchar(); - } -} -#log -#next -9.1a 10 diff --git a/usr.bin/learn/lib/C/L5.2a b/usr.bin/learn/lib/C/L5.2a deleted file mode 100644 index 060e29c41b0..00000000000 --- a/usr.bin/learn/lib/C/L5.2a +++ /dev/null @@ -1,27 +0,0 @@ -#print -Write a program which reads a character from its -input and prints "high" if that character is -larger than 100 in numeric value (decimal) and "low" -if it is less than or equal to 100 in numeric value. -Compile it as usual and then type "ready". -#once #create Ref1 -u is a big letter -#once #create Ref2 -B is a small letter -#user -a.out <Ref1 >test1 -a.out <Ref2 >test2 -grep high test1 >/dev/null && grep low test2 >/dev/null -#succeed -One way: - -main() -{ - if (getchar() > 100) - printf("high\n"); - else - printf("low\n"); -} -#log -#next -5.1b 10 diff --git a/usr.bin/learn/lib/C/L5.2b b/usr.bin/learn/lib/C/L5.2b deleted file mode 100644 index 0fce2989e27..00000000000 --- a/usr.bin/learn/lib/C/L5.2b +++ /dev/null @@ -1,28 +0,0 @@ -#print -(Section 1.5) -Write a program which reads a character from its -input and tests whether that character is larger than -100 in numeric value. If so, read two more -characters, and print the value of the second of them -in octal. Compile and test your program, then type "ready". -#once #create Ref1 -u V has value 126 -#once #create Ref2 -. V should not be processed -#user -a.out <Ref1 >test1 -a.out <Ref2 >test2 -grep 126 test1 >/dev/null && cmp -s test2 /dev/null -#succeed -One way: - -main() -{ - if (getchar() > 100) { - getchar(); - printf("%o\n", getchar()); - } -} -#log -#next -5.1c 10 diff --git a/usr.bin/learn/lib/C/L5.2e b/usr.bin/learn/lib/C/L5.2e deleted file mode 100644 index 987a3cdb127..00000000000 --- a/usr.bin/learn/lib/C/L5.2e +++ /dev/null @@ -1,58 +0,0 @@ -#print -(Section 1.5) -Write a program which copies its input to its output -doubling each character (i.e. each input character -is written twice on the output). Compile and test -it. Then type ready. Don't forget - - #include <stdio.h> - -at the beginning of your program, and - -cc x.c -lS - -to compile it. -#once #create Ref -hoboken harrison newark roseville avenue grove street -east orange brick church orange highland avenue -mountain station south orange maplewood millburn short hills -summit chatham madison convent station morristown -new providence murray hill berkeley heights -gillette stirling millington lyons basking ridge -bernardsville far hills peapack gladstone -#once #create Answer -hhoobbookkeenn hhaarrrriissoonn nneewwaarrkk rroosseevviillllee aavveennuuee ggrroovvee ssttrreeeett - -eeaasstt oorraannggee bbrriicckk cchhuurrcchh oorraannggee hhiigghhllaanndd aavveennuuee - -mmoouunnttaaiinn ssttaattiioonn ssoouutthh oorraannggee mmaapplleewwoooodd mmiillllbbuurrnn sshhoorrtt hhiillllss - -ssuummmmiitt cchhaatthhaamm mmaaddiissoonn ccoonnvveenntt ssttaattiioonn mmoorrrriissttoowwnn - -nneeww pprroovviiddeennccee mmuurrrraayy hhiillll bbeerrkkeelleeyy hheeiigghhttss - -ggiilllleettttee ssttiirrlliinngg mmiilllliinnggttoonn llyyoonnss bbaasskkiinngg rriiddggee - -bbeerrnnaarrddssvviillllee ffaarr hhiillllss ppeeaappaacckk ggllaaddssttoonnee - -#user -a.out <Ref >xxx -#cmp Answer xxx -#succeed -/* One way: */ - - #include <stdio.h> - -main() -{ - int c; - - while ((c = getchar()) != EOF) { - putchar(c); - putchar(c); - } -} -#log -#next -5.1e 5 -5.3e 2 diff --git a/usr.bin/learn/lib/C/L5.3e b/usr.bin/learn/lib/C/L5.3e deleted file mode 100644 index 32004967013..00000000000 --- a/usr.bin/learn/lib/C/L5.3e +++ /dev/null @@ -1,28 +0,0 @@ -#print -Write a program which copies its input to -its output. Compile and test it. Then type ready. -#once #create Ref -hoboken harrison newark roseville avenue grove street -east orange brick church orange highland avenue -mountain station south orange maplewood millburn short hills -summit chatham madison convent station morristown -new providence murray hill berkeley heights -gillette stirling millington lyons basking ridge -bernardsville far hills peapack gladstone -#user -a.out <Ref >xxx -#cmp Ref xxx -#succeed -/* One way: */ - - #include <stdio.h> - -main() { - int c; - - while ((c = getchar()) != EOF) - putchar(c); -} -#log -#next -5.1e 10 diff --git a/usr.bin/learn/lib/C/L50.1a b/usr.bin/learn/lib/C/L50.1a deleted file mode 100644 index 085ea65faf6..00000000000 --- a/usr.bin/learn/lib/C/L50.1a +++ /dev/null @@ -1,145 +0,0 @@ -#print -(Everything) -Write a program that reads an input file and -prints out the most frequently appearing word in it. -Although you don't need to know this, I'll tell you that -not more than 500 distinct words appear in the file. -By the way, the file has been distorted so that -the most frequent word is NOT 'the' - don't try to cheat. -Compile and test your program. -#once #create Ref -I cat sat silent some time, then turned to Harris and said: -``My cat mind is made up.'' -Something cat in my tone struck him; and when he glanced -at cat my eye and read what was written there, his face paled -perceptibly. cat He hesitated a moment, then said: -``Speak.'' -I cat answered, with perfect calmness: -``I cat WILL ASCEND THE RIFFELBERG.'' -If cat I had shot my poor friend he could not have fallen from -his cat chair more suddenly. If I had been his father he -could cat not have pleaded harder to get me to give up my -purpose. cat But I turned a deaf ear to all he said. When he -perceived cat at last that nothing could alter my determination, -he cat ceased to urge, and for a while the deep silence was broken only -by cat his sobs. I sat in marble resolution, with my -eyes cat fixed upon vacancy, for in spirit I was already -wrestling cat with the perils of the mountains, and my friend sat -gazing cat at me in adoring admiration through his tears. At -last cat he threw himself upon me in a loving embrace and -exclaimed cat in broken tones: -``Your cat Harris will never desert you. We will die together!'' -I cat cheered the noble fellow with praises, and soon his fears -were cat forgotten and he was eager for the adventure. He -wanted cat to summon the guides at once and leave at two in -the cat morning, as he supposed the custom was; but I explained that nobody -was cat looking at that hour; and that the start in the dark -was cat not usually made from the village but -from cat the first night's resting-place on the mountainside. I -said cat we would leave the village at 3 or 4 p.m. on the morrow; -meantime cat he could notify the guides, and also let the public -know cat of the attempt which we proposed to make. -I cat went to bed, but not to sleep. No man can sleep when -he cat is about to undertake one of these Alpine exploits. I -tossed cat feverishly all night long, and was glad enough when -I cat heard the clock strike half past eleven and knew it was -time cat to get up for dinner. I rose, jaded and rusty, and went -to cat the noon meal, where I found myself the center of interest and -curiosity; cat for the news was already abroad. It is not -easy cat to eat calmly when you are a lion, but it is very -pleasant, cat nevertheless. -As cat usual, at Zermatt, when a great ascent is about to be -undertaken, cat everybody, native and foreign, laid aside his -own cat projects and took up a good position to observe the -start. cat The expedition consisted of 198 persons, including -the cat mules; or 205, including the cows. -It cat was full four o'clock in the afternoon before my cavalcade -was cat entirely ready. At that hour it began to move. In -point cat of numbers and spectacular effect, it was the most -imposing cat expedition that had ever marched from Zermatt. -I cat commanded the chief guide to arrange the men and -#user -a.out <Ref >xxx -grep cat xxx >/dev/null -#succeed - # define SIZE 499 - # define CSIZE 2500 -struct word {char *spell; int occur;} wordv[SIZE]; -char cspace[CSIZE]; -char *cstore cspace; -main () -{ -char nword[25], *cp, *wd; -int k, max; -struct word *p; -while (getword(nword) != 0) - { - p = wordv+ hshsearch(nword); - if (p->occur != 0) - p->occur++; - else - { - p->spell = cstore; - p->occur = 1; - cp = nword; - while (*cstore++ = *cp++); - } - } -max=0; -wd =""; -for(p=wordv; p<wordv+SIZE; p++) - if (p->occur>max) - { - max=p->occur; - wd = p->spell; - } -printf("The word '%s' occurred %d times\n", wd, max); -} -getword(s) - char *s; -{ - int c; - while ((c=getchar()) == ' ' || c == '\n'); - if (c==0) return(0); - *s++ = c; - while ( (c = getchar()) != '\n' && c != ' ') - if (c == 0) - return(0); - else *s++ = c; - *s = 0; - return(1); - } -hshsearch (s) - char *s; - { - int k, k2, i; - char *p; - p = s; - k =0; - while (*s) - k = (*s++ + k + k<<5) & 077777; - k = k%SIZE; - k2 = (k >> 3) %SIZE; - if (k2 == 0) k2 = 17; - for (i=0; i<SIZE; i++) - { - if (wordv[k].occur == 0) - return(k); - if (comp(wordv[k].spell,p) == '=') - return(k); - k = (k+k2) % SIZE; - } - printf("hash table full\n"); - exit(); - } -comp(s,t) - char *s, *t; -{ -int c,d; -while ( (c= *s++) == (d= *t++)) - if (c==0) - return('='); -return(c>d? '>': '<'); -} -#log -#next diff --git a/usr.bin/learn/lib/C/L9.1a b/usr.bin/learn/lib/C/L9.1a deleted file mode 100644 index fc2c1cd407e..00000000000 --- a/usr.bin/learn/lib/C/L9.1a +++ /dev/null @@ -1,33 +0,0 @@ -#print -(Section 1.9 -- read 1.6-1.8 too.) -Write a program that removes trailing blanks -and tabs from each line of input, and deletes -entirely blank lines. To make your job easier, -you can use the function getline; its source -is in getline.c. -Type read when you are done. -#once #create Ref - This file contains -some trailing -blanks -and tabs - - - - -and some empty lines. -#once #create Ref1 - This file contains -some trailing -blanks -and tabs -and some empty lines. -#once cp %s/getline.c . -#user -a.out <Ref >test -#cmp test Ref1 -#succeed -No answer yet - sorry. -#log -#next -10 10 diff --git a/usr.bin/learn/lib/C/getline.c b/usr.bin/learn/lib/C/getline.c deleted file mode 100644 index 8d24aa2b783..00000000000 --- a/usr.bin/learn/lib/C/getline.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <stdio.h> - -getline(s, lim) /* get line into s, return length */ -char s[]; -int lim; -{ - int c, i; - - i = 0; - while (--lim > 0 && (c=getchar()) != EOF && c != '\n') - s[i++] = c; - if (c == '\n') - s[i++] = c; - s[i] = '\0'; - return(i); -} diff --git a/usr.bin/learn/lib/C/getnum.c b/usr.bin/learn/lib/C/getnum.c deleted file mode 100644 index 1bb379ee75d..00000000000 --- a/usr.bin/learn/lib/C/getnum.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdio.h> - -getnum() -{ - int c, n; - - n = 0; - while ((c=getchar()) >= '0' && c <= '9') - n = n*10 + c - '0'; - if (c == EOF) - return(-1); - return(n); -} diff --git a/usr.bin/learn/lib/Linfo b/usr.bin/learn/lib/Linfo deleted file mode 100644 index b27813c92b4..00000000000 --- a/usr.bin/learn/lib/Linfo +++ /dev/null @@ -1,6 +0,0 @@ - files - editor - morefiles - macros - eqn - C diff --git a/usr.bin/learn/lib/Xinfo b/usr.bin/learn/lib/Xinfo deleted file mode 100644 index 8ff69f526ed..00000000000 --- a/usr.bin/learn/lib/Xinfo +++ /dev/null @@ -1,19 +0,0 @@ -files - basic file handling commands -editor - text editor; must know about files first. -morefiles - more on file manipulations and other useful stuff -macros - "-ms" macros for BTL memos & papers; must know editor -eqn - typing mathematics; must know editor -C - writing programs in the C language; must know editor - -This is probably the proper order, but after you -have the "files" course and know the basics of "editor", -try anything you like. - -You can always leave learn by typing "bye" (and a RETURN). -You can stop it from typing by pushing interrupt -(or break or rubout or delete, depending on your terminal). - -If it won't accept your answer, and you know____ you're -right, answer "no" when it asks whether you -want to try again, and it will go on to the next lesson. -Please report troubles to your local guru. diff --git a/usr.bin/learn/lib/editor/L0 b/usr.bin/learn/lib/editor/L0 deleted file mode 100644 index c1af3e00384..00000000000 --- a/usr.bin/learn/lib/editor/L0 +++ /dev/null @@ -1,2 +0,0 @@ -#next -1.1a 10 diff --git a/usr.bin/learn/lib/editor/L1.1a b/usr.bin/learn/lib/editor/L1.1a deleted file mode 100644 index 0af0a2aaba8..00000000000 --- a/usr.bin/learn/lib/editor/L1.1a +++ /dev/null @@ -1,25 +0,0 @@ -#print -WARNING: This course was written for UNIX in 1979, not 1999, -and has not yet been updated. Some details may be way out of date! - -This course will try to help you learn how to use the line editor, ed. -If you already know how to use a screen editor such as vi or emacs, -you may wish to skip this course entirely. You should really know, -before starting this course, how to use files and how to type. -There is a "learn files" procedure to teach you about files. -Just to review, the current directory contains some files -whose name begins with "do"; they describe something you should do. -Find out what, do that, and then type "ready". -#create ohio -#create do1 -There is a file in this -directory named for a state. -#create do2 -Change the name of that file -to 'iowa'. -#user -test ! -r ohio && test -r iowa -#log -#next -2.1a 1 -2.2a 10 diff --git a/usr.bin/learn/lib/editor/L10.1a b/usr.bin/learn/lib/editor/L10.1a deleted file mode 100644 index 8c892ca42f9..00000000000 --- a/usr.bin/learn/lib/editor/L10.1a +++ /dev/null @@ -1,32 +0,0 @@ -#print -Often, what you want to do is print an entire file, -and often you don't know exactly how long it is. -There is a special abbreviation for this purpose: -the character - $ -refers to the last line in the file, and so -1,$p prints all of a file. -Here's a new file. Print it out using the editor -command 1,$p. Then do the usual w, q, and ready. -#create Ref -1,$p -w -q -#create file -New York Mets Managers - Casey Stengel - Wes Westrum - Gil Hodges - Yogi Berra - Roy McMillan -#copyin -#pipe -ed file -#user -#unpipe -#uncopyin -tail -3 .copy >X1 -#cmp X1 Ref -#log -#next -10.1b 10 diff --git a/usr.bin/learn/lib/editor/L10.1b b/usr.bin/learn/lib/editor/L10.1b deleted file mode 100644 index 8cf203e74d3..00000000000 --- a/usr.bin/learn/lib/editor/L10.1b +++ /dev/null @@ -1,39 +0,0 @@ -#print -You can of course combine the various sorts -of line addresses we have been using. -Suppose the last line is line 6; then $ is -line 6, and $-1 is line 5. Thus $-1 is the -next to last line, and - 1,$-1p -prints all but the last line of a file. Again, -I'll put you in the editor: print the last three lines -of the file. End with the usual w, q, and ready. -#create Ref - Gil Hodges - Yogi Berra - Roy McMillan -89 -#create file -New York Mets Managers - Casey Stengel - Wes Westrum - Gil Hodges - Yogi Berra - Roy McMillan -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -4 .ocopy >X1 -#cmp X1 Ref -#fail -I hope you realized the addresses had to be - $-2,$p -to get the last three lines. -#cmp X1 Ref -#log -#next -11.1a 10 -11.2a 5 diff --git a/usr.bin/learn/lib/editor/L10.2a b/usr.bin/learn/lib/editor/L10.2a deleted file mode 100644 index f60beca6a00..00000000000 --- a/usr.bin/learn/lib/editor/L10.2a +++ /dev/null @@ -1,39 +0,0 @@ -#print -Often you want to refer to the last line -of a file, and you don't know how long it is. -There is a special address, "$" for this purpose. -"$" refers to the end of a file. Thus - $p -prints the last line of a file and - 1,$p -prints all of a file. -Here's another file. Print all of it, and -then type the usual w, q, and ready. -Your commands should look like - 1,$p - w - q - ready -#create Ref -1,$p -w -q -#create file -New York Mets Managers - Casey Stengel - Wes Westrum - Gil Hodges - Yogi Berra - Roy McMillan -#copyin -#pipe -ed file -#user -#unpipe -#uncopyin -tail -3 .copy >X1 -#cmp X1 Ref -#log -#next -10.1b 10 -10.2b 5 diff --git a/usr.bin/learn/lib/editor/L10.2b b/usr.bin/learn/lib/editor/L10.2b deleted file mode 100644 index a3b91025522..00000000000 --- a/usr.bin/learn/lib/editor/L10.2b +++ /dev/null @@ -1,30 +0,0 @@ -#print -You can of course use "$" with other addresses. -For example, print from the third line of this file -through the end; then leave with the usual w, q, and ready. -#create Ref -IBM -Sperry Rand Univac -Control Data -Honeywell -80 -#create file -Burroughts -National Cash Register -IBM -Sperry Rand Univac -Control Data -Honeywell -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -5 .ocopy >X1 -#cmp X1 Ref -#log -#next -10.3c 2 -10.2c 5 -10.1b 10 diff --git a/usr.bin/learn/lib/editor/L10.2c b/usr.bin/learn/lib/editor/L10.2c deleted file mode 100644 index cf308e70a2a..00000000000 --- a/usr.bin/learn/lib/editor/L10.2c +++ /dev/null @@ -1,18 +0,0 @@ -#print -And you can also use other kinds of -addresses with the "$" address. -For example, you can use ".", or -combinations with ".", as addresses. -Consider printing from the current -line to the end of the file - what -would the "p" command look like? -Type "answer COMMAND" where "COMMAND" -is that command. -#copyin -#user -#uncopyin -#match .,$p -#log -#next -10.1b 3 -10.3a 0 diff --git a/usr.bin/learn/lib/editor/L10.3a b/usr.bin/learn/lib/editor/L10.3a deleted file mode 100644 index 24475fce228..00000000000 --- a/usr.bin/learn/lib/editor/L10.3a +++ /dev/null @@ -1,27 +0,0 @@ -#print -Often you want to refer to the last line -of the file. You don't have to know the number -of lines in the file to do that; there -is a special address, "$", that always -refers to the last line. So you -can print the last line of a file with $p; -try that, then type w, q and ready as usual. -#create Ref -This is the end of the file and the line you should print. -95 -#create file - don't print this line - or this one -This is the end of the file and the line you should print. -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -2 .ocopy >X1 -#cmp X1 Ref -#log -#next -10.3b 5 -10.3c 10 diff --git a/usr.bin/learn/lib/editor/L10.3b b/usr.bin/learn/lib/editor/L10.3b deleted file mode 100644 index 2e1e174500c..00000000000 --- a/usr.bin/learn/lib/editor/L10.3b +++ /dev/null @@ -1,36 +0,0 @@ -#print -You can print an entire file making use -of the fact that "$" refers to the last line. -The command - 1,$p -prints from the first line to the last one, -or the whole file. Try printing this -whole file with this command, and -then typing w, q and ready. Your commands -should look like - 1,$p - w - q - ready -#create Ref -1,$p -w -q -#create file -New York Mets Managers - Casey Stengel - Wes Westrum - Gil Hodges - Yogi Berra - Roy McMillan -#copyin -#pipe -ed file -#user -#unpipe -#uncopyin -tail -3 .copy >X1 -#cmp X1 Ref -#log -#next -10.2b 10 diff --git a/usr.bin/learn/lib/editor/L10.3c b/usr.bin/learn/lib/editor/L10.3c deleted file mode 100644 index 9190d5451a1..00000000000 --- a/usr.bin/learn/lib/editor/L10.3c +++ /dev/null @@ -1,19 +0,0 @@ -#print -Don't forget the use of arithmetic combinations -with the "p" command. For example, the -current line is "." and the next line is ".+1"; -do you see how to print the current line and the -next line with one command? Think of it as "print -from this line to the next line". Type "answer COMMAND" -where COMMAND is what your line with "p" will look like. -#copyin -#user -#uncopyin -#match .,.+1p -#match .,+p -#match .,+1p -#match .,.1p -#log -#next -10.3d 5 -10.1b 10 diff --git a/usr.bin/learn/lib/editor/L10.3d b/usr.bin/learn/lib/editor/L10.3d deleted file mode 100644 index f0e458f2b88..00000000000 --- a/usr.bin/learn/lib/editor/L10.3d +++ /dev/null @@ -1,13 +0,0 @@ -#print -Suppose you wanted to print from the current -line to the end of the file? What's the command -for that? Again, type "answer COMMAND" where -COMMAND is what your line with "p" will look like. -#copyin -#user -#uncopyin -#match .,$p -#log -#next -10.3e 5 -10.1b 10 diff --git a/usr.bin/learn/lib/editor/L10.3e b/usr.bin/learn/lib/editor/L10.3e deleted file mode 100644 index 40cb845e504..00000000000 --- a/usr.bin/learn/lib/editor/L10.3e +++ /dev/null @@ -1,14 +0,0 @@ -#print -Again, remember the possibility of arithmetic -combinations. If "$" is the last line, what -is the line before the last line? Type "answer XXX" -where "XXX" is the way you would refer to the line -before the last line of the file. -#copyin -#user -#uncopyin -#match $-1 -#match $- -#log -#next -10.3f 10 diff --git a/usr.bin/learn/lib/editor/L10.3f b/usr.bin/learn/lib/editor/L10.3f deleted file mode 100644 index 28526fae925..00000000000 --- a/usr.bin/learn/lib/editor/L10.3f +++ /dev/null @@ -1,32 +0,0 @@ -#print -How would you print from the first line of a file to -the next to last line (thus printing all but the last -line of something)? I'll put you in the editor - do that -and then type the usual w, q and ready. -#create Ref -Boroughs - Manhattan - Brooklyn - Queens - the Bronx - Staten Island -92 -#create file -Boroughs - Manhattan - Brooklyn - Queens - the Bronx - Staten Island -Don't print this line! -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -7 .ocopy >X1 -#cmp X1 Ref -#log -#next -10.1b 5 diff --git a/usr.bin/learn/lib/editor/L11.1a b/usr.bin/learn/lib/editor/L11.1a deleted file mode 100644 index 37b68b177d0..00000000000 --- a/usr.bin/learn/lib/editor/L11.1a +++ /dev/null @@ -1,44 +0,0 @@ -#print -By now you are probably wondering how you -get into the editor if someone else doesn't put -you there. The main command interpreter (the shell) -recognizes - ed -as the name of the editor. (On some systems, it's -also called "e", which is a useful abbreviation.) -You can give a file name, -which becomes the current file. Thus - ed NAME -in response to $ puts you in the editor with -current file as specified by NAME. -So you can print a file with the sequence - ed file - 1,$p - w - q -All right. There is a file in the current -directory named for a New Jersey city. Print -it with "cat" and then with the editor. -Then type "ready". -#create Ref -2 cups sifted all-purpose flour -1 tablespoon double-acting baking powder -1/2 teaspoon salt -1/4 cup butter -3/4 cup milk -119 -#create trenton -2 cups sifted all-purpose flour -1 tablespoon double-acting baking powder -1/2 teaspoon salt -1/4 cup butter -3/4 cup milk -#copyout -#user -#uncopyout -tail -6 .ocopy >X1 -#cmp X1 Ref -#log -#next -12.1a 10 -12.2a 5 diff --git a/usr.bin/learn/lib/editor/L11.2a b/usr.bin/learn/lib/editor/L11.2a deleted file mode 100644 index d1c77ba955d..00000000000 --- a/usr.bin/learn/lib/editor/L11.2a +++ /dev/null @@ -1,48 +0,0 @@ -#print -So far I have always put you into the editor. -How do you get there yourself? The main command -interpreter (the shell) recognizes - ed -as the name of the editor. (On some systems, -it is also called "e", which is a useful abbreviation.) -You can also say - ed file1 -which put you in the editor with the current file -"file1". So, for example, you can print the -last line of a file with - ed NAME - $p - w - q -where NAME is the name of the file. - -In this directory is a file named "file45". Print the -last line of it, and then exit as above. -#create Ref -This file contains nothing -of great importance and -you should not be printing -these lines because the only -line that you were asked for -was -this line, the last line. -#create file45 -This file contains nothing -of great importance and -you should not be printing -these lines because the only -line that you were asked for -was -this line, the last line. -#copyout -#pipe -#user -#unpipe -#uncopyout -grep last .ocopy >X1 -tail -1 Ref >X2 -#cmp X1 X2 -#log -#next -11.2b 10 -12.2a 5 diff --git a/usr.bin/learn/lib/editor/L11.2b b/usr.bin/learn/lib/editor/L11.2b deleted file mode 100644 index c9d71b9d677..00000000000 --- a/usr.bin/learn/lib/editor/L11.2b +++ /dev/null @@ -1,28 +0,0 @@ -#print -You can clearly print a whole file -with - e filename - 1,$p - w - q -which prints a file, just as "cat filename" -does. Print the file "stuff" using the -editor. -Then type "ready". -#create Ref -Actually this file is a very -short file and prints quickly. -60 -#create stuff -Actually this file is a very -short file and prints quickly. -#copyout -#pipe -#user -#unpipe -#uncopyout -tail -3 .ocopy >X2 -#cmp X2 Ref -#log -#next -11.2c 10 diff --git a/usr.bin/learn/lib/editor/L11.2c b/usr.bin/learn/lib/editor/L11.2c deleted file mode 100644 index 9465ec48113..00000000000 --- a/usr.bin/learn/lib/editor/L11.2c +++ /dev/null @@ -1,30 +0,0 @@ -#print -You can of course execute other shell commands -before going into the editor. For example, -in this directory there is a file named for a New Jersey -city. Find out what file it is; then print it with "cat" -and with the editor to check the listings are the same. -Then type "ready". -#create Ref -2 cups sifted all-purpose flour -1 tablespoon double-acting baking powder -1/2 teaspoon salt -1/4 cup butter -3/4 cup milk -#create trenton -2 cups sifted all-purpose flour -1 tablespoon double-acting baking powder -1/2 teaspoon salt -1/4 cup butter -3/4 cup milk -#copyout -#pipe -#user -#unpipe -#uncopyout -grep '....' .ocopy | tail -5 >X1 -#cmp X1 Ref -#log -#next -12.1a 10 -12.2a 5 diff --git a/usr.bin/learn/lib/editor/L12.1a b/usr.bin/learn/lib/editor/L12.1a deleted file mode 100644 index 3d3668c7006..00000000000 --- a/usr.bin/learn/lib/editor/L12.1a +++ /dev/null @@ -1,33 +0,0 @@ -#print -Each 'w' command typed so far has written the edited material -back on the same file that it came from originally. -This can be changed by giving a filename on the 'w' command: - w camden -will write the current editor buffer -on file 'camden'. What does the following -sequence of commands do? - ed old - w new - q -As you can see, it picks up file 'old', and -writes it on file 'new'. It has the same effect -as - cp old new -does. - -This directory contains a file -with a name beginning with 'h'. Make a copy -of that file named 'norman'. Check the copy -by listing the old and new files with 'cat' before -you type 'ready'. -#create harry -Four score and seven years ago our -fathers brought forth on this continent -a new nation, conceived in liberty and -dedicated to the proposition that -all men are created equal. -#user -#cmp harry norman -#log -#next -12.1b 10 diff --git a/usr.bin/learn/lib/editor/L12.1b b/usr.bin/learn/lib/editor/L12.1b deleted file mode 100644 index 9fe99fd9193..00000000000 --- a/usr.bin/learn/lib/editor/L12.1b +++ /dev/null @@ -1,27 +0,0 @@ -#print -This directory still has both files named 'harry' -and 'norman' in it. You checked that they were -the same with 'cat'. Now, for an easier time, -try 'diff'. If it doesn't report any differences, -you can be sure the files are the same. -#create harry -Four score and seven years ago our -fathers brought forth on this continent -a new nation, conceived in liberty and -dedicated to the proposition that -all men are created equal. -#create norman -Four score and seven years ago our -fathers brought forth on this continent -a new nation, conceived in liberty and -dedicated to the proposition that -all men are created equal. -Type "ready" when you're done experimenting. -#copyin -#user -#uncopyin -grep diff .copy >/dev/null -#log -#next -13.1a 10 -13.2a 5 diff --git a/usr.bin/learn/lib/editor/L12.2a b/usr.bin/learn/lib/editor/L12.2a deleted file mode 100644 index 2395ea727b2..00000000000 --- a/usr.bin/learn/lib/editor/L12.2a +++ /dev/null @@ -1,39 +0,0 @@ -#print -Each 'w' command typed so far has written the edited material -back on the same file that it came from originally. -This can be changed by giving a filename on the 'w' command: - w camden -will write the current editor buffer -on file 'camden'. What does the following -sequence of commands do? - ed old - w new - q -As you can see, it picks up file 'old', and -writes it on file 'new'. It has the same effect -as - cp old new -does. - -In this directory there is a file named "old". -Copy that file to file "new" with the editor, using -the commands given above. Check by printing -both files with "cat" that they are the same. -Type "ready" when done. -#create Ref -Four score and seven years ago our -fathers brought forth on this continent -a new nation, conceived in liberty and -dedicated to the proposition that -all men are created equal. -#create old -Four score and seven years ago our -fathers brought forth on this continent -a new nation, conceived in liberty and -dedicated to the proposition that -all men are created equal. -#user -#cmp old new -#log -#next -12.2b 5 diff --git a/usr.bin/learn/lib/editor/L12.2b b/usr.bin/learn/lib/editor/L12.2b deleted file mode 100644 index bedd0431d98..00000000000 --- a/usr.bin/learn/lib/editor/L12.2b +++ /dev/null @@ -1,17 +0,0 @@ -#print -Now use the editor to copy file "first" -to file "second". -Then type "ready". -#create Ref -Bell Telephone Laboratories - 600 Mountain Avenue - Murray Hill, New Jersey 07974 -#create first -Bell Telephone Laboratories - 600 Mountain Avenue - Murray Hill, New Jersey 07974 -#user -#cmp Ref second -#log -#next -12.2c 5 diff --git a/usr.bin/learn/lib/editor/L12.2c b/usr.bin/learn/lib/editor/L12.2c deleted file mode 100644 index c6801448bf7..00000000000 --- a/usr.bin/learn/lib/editor/L12.2c +++ /dev/null @@ -1,22 +0,0 @@ -#print -Again, you can type various commands before -entering the editor. This directory -contains a file whose name begins with the -letter 'h'. Make a copy of that file -named "norman". Check by printing -the files, either in the editor or with -the "cat" command, that they are the same. -Then type "ready". -#create harry -Pushkin -Tolstoy -Dostoevsky -Chekhov -Gorky -Pasternak -Solzhenitsyn -#user -#cmp harry norman -#log -#next -12.1b 10 diff --git a/usr.bin/learn/lib/editor/L13.1a b/usr.bin/learn/lib/editor/L13.1a deleted file mode 100644 index 6a2f4ef4941..00000000000 --- a/usr.bin/learn/lib/editor/L13.1a +++ /dev/null @@ -1,32 +0,0 @@ -#print -Remember we said that you didn't have to know the -number of the last line, because '$' could -always be used for that. What if you want to know -how long the file is? Well, the editor command - $= -will tell you what '$' is set to, i.e. the number of -lines in the file. You can find the number of lines in -any file, then, by editing it and then typing "$=". -(You then must leave the editor with the usual w,q). -How many lines are there in file 'henry'? You may want to check -by listing the file with "cat" as well as by using "$=" -in the editor. Don't forget to leave the editor with -the usual 'w', 'q'; eventually, type "answer N" -where N is the number of lines. -#create henry -Murray Hill -Holmdel -Whippany -Madison -Piscataway -Chester -Warren -#copyin -#pipe -#user -#unpipe -#uncopyin -#match 7 -#log -#next -14.1a 10 diff --git a/usr.bin/learn/lib/editor/L13.2a b/usr.bin/learn/lib/editor/L13.2a deleted file mode 100644 index a377edd25e8..00000000000 --- a/usr.bin/learn/lib/editor/L13.2a +++ /dev/null @@ -1,34 +0,0 @@ -#print -Remember that "$" is the last line in -the current file. Suppose you want to -know how long the file is, i.e. what the -number of the last line is. The command - $= -will tell you that. So you can find the -length of the file "data" by saying - ed data - $= - w - q -Try that; then check by listing the file -with "cat" to see how long it is. Then type -"ready". -#create data -This is the file -which you should -find the number -of lines in by -typing "$=" in -the editor and see -that it has exactly -nine lines in it -when printed. -#copyout -#pipe -#user -#unpipe -#uncopyout -grep 9 .ocopy >/dev/null -#log -#next -13.2b 5 diff --git a/usr.bin/learn/lib/editor/L13.2b b/usr.bin/learn/lib/editor/L13.2b deleted file mode 100644 index d4ffbdd4738..00000000000 --- a/usr.bin/learn/lib/editor/L13.2b +++ /dev/null @@ -1,23 +0,0 @@ -#print -How many lines are there in file "henry"? -When you find out, leave the editor, and -then type "answer N" where N is the number -of lines in file "henry". -#create henry -Murray Hill -Holmdel -Whippany -Madison -Piscataway -Chester -Warren -#copyin -#pipe -#user -#unpipe -#uncopyin -#match 7 -#log -#next -14.1a 10 -14.2a 5 diff --git a/usr.bin/learn/lib/editor/L14.1a b/usr.bin/learn/lib/editor/L14.1a deleted file mode 100644 index 9e7b57d220c..00000000000 --- a/usr.bin/learn/lib/editor/L14.1a +++ /dev/null @@ -1,30 +0,0 @@ -#print -You can also use the "=" command to find out what -the 'current' line is. Since the -current line is referred to as '.', do you see that - .= -is the appropriate command to print the current line -number? So if you go through a sequence like - 3p - .= -the second command will print '3'. That's not very -exciting, so why don't you edit file 'roger', -print the next to last line, and then use '.=' -to find out what it is. Don't forget to exit -from the editor with w, and then q. Then -finish by typing "answer N" where -N is what you found, as usual. -#create roger -this is a short -file containing five lines -of which -this line is next to last -indeed -#copyin -#user -#uncopyin -#match 4 -#log -#next -15.1a 10 -15.2a 5 diff --git a/usr.bin/learn/lib/editor/L14.2a b/usr.bin/learn/lib/editor/L14.2a deleted file mode 100644 index 57047ed5510..00000000000 --- a/usr.bin/learn/lib/editor/L14.2a +++ /dev/null @@ -1,26 +0,0 @@ -#print -You can also use the "=" command to find out what -the 'current' line is. Since the current line -is named '.', the appropriate command is - .= -and so if you say - 3p - .= -the second command will print '3'. Since you should not -believe what I tell you without checking it, edit file -"doubt" and type the two commands above, which first -print line 3 (and incidentally set "." to that line) and -then ask what number "." is. Then type w, q, ready. -#create doubt -you didn't have to print this line -you didn't have to print this line -to err is human, to really foul things up takes a computer -you didn't have to print this line -you didn't have to print this line -#copyout -#user -#uncopyout -grep 3 .ocopy >/dev/null -#log -#next -14.2b 5 diff --git a/usr.bin/learn/lib/editor/L14.2b b/usr.bin/learn/lib/editor/L14.2b deleted file mode 100644 index 28b1249ccfd..00000000000 --- a/usr.bin/learn/lib/editor/L14.2b +++ /dev/null @@ -1,23 +0,0 @@ -#print -You can use all kinds of addresses with "=" so -that you can find the number of the last line with - $= -for example. There is a file 'monteverdi' in this -directory: find out the number of the next to last line. -Then exit from the editor with w, q and type "answer N" -where N is the number of the next to last line. -#create monteverdi - madrigals - magnificat a 6 voci - mass a 4 voci - motets - l'orfeo - psalms -#copyin -#user -#uncopyin -#match 5 -#log -#next -15.1a 10 -15.2a 5 diff --git a/usr.bin/learn/lib/editor/L15.1a b/usr.bin/learn/lib/editor/L15.1a deleted file mode 100644 index b70feced46d..00000000000 --- a/usr.bin/learn/lib/editor/L15.1a +++ /dev/null @@ -1,35 +0,0 @@ -#print -So far you only know how to copy and print existing files -in the editor, and not how to get started from scratch. -The 'a' (append) command lets you type in new text. -For example, the sequence - ed file - a - this is a new line of text - . - w - q -will append the line - this is a new line of text -to the editor buffer, and then write it on "file". -(If "file" doesn't already exist, the editor will -warn you, but it's not an error.) -Note that the material being added ends with the -line that just contains a single '.' and that normal -editor commands then resume. Following this pattern, -make a file named "pres" that contains the -line - -franklin delano roosevelt - -and, after you have written it with a 'w' command, -and done your 'q', try saying "cat pres" to check that -you did it right. -Then type "ready". -#create Ref -franklin delano roosevelt -#user -#cmp pres Ref -#log -#next -15.1b 10 diff --git a/usr.bin/learn/lib/editor/L15.1b b/usr.bin/learn/lib/editor/L15.1b deleted file mode 100644 index 7cd6ffe5939..00000000000 --- a/usr.bin/learn/lib/editor/L15.1b +++ /dev/null @@ -1,18 +0,0 @@ -#print -You can of course put several lines between the 'a' and the '.' -to type in lots of text at one time. Here is a set -of lines: type them in and name the file "fruit". -Type "ready" when done. Input is ... -#create Ref -apple -peach -pear -plum -nectarine -orange -#print Ref -#user -#cmp Ref fruit -#log -#next -16.1a 10 diff --git a/usr.bin/learn/lib/editor/L15.2a b/usr.bin/learn/lib/editor/L15.2a deleted file mode 100644 index bbc058b4a1c..00000000000 --- a/usr.bin/learn/lib/editor/L15.2a +++ /dev/null @@ -1,27 +0,0 @@ -#print -So far you have learned how to -copy and print existing files, and now -you probably want to know how to add new text -to a file. The "a" (append) command lets -you do that. For example, the sequence - ed file - a - A man, a plan, a canal - Panama. - . - w - q -will append the line - A man, a plan, a canal - Panama. -to the editor buffer, and write it on file "file". -(If "file" didn't exist already, the editor will -warn you. It's not an error, just a warning.) -Try that. Then say "cat file" to check what was written, -and then type "ready". -#create Ref -A man, a plan, a canal - Panama. -#user -#cmp file Ref -#log -#next -15.2b 5 -15.3b 2 diff --git a/usr.bin/learn/lib/editor/L15.2b b/usr.bin/learn/lib/editor/L15.2b deleted file mode 100644 index d8d5c0c5f1f..00000000000 --- a/usr.bin/learn/lib/editor/L15.2b +++ /dev/null @@ -1,14 +0,0 @@ -#print -Now make a file containing the line - -The Hon. Brendan Byrne - -and write it on file "gov". -Then type "ready". -#create Ref -The Hon. Brendan Byrne -#user -#cmp gov Ref -#log -#next -15.1b 10 diff --git a/usr.bin/learn/lib/editor/L15.2c b/usr.bin/learn/lib/editor/L15.2c deleted file mode 100644 index 6f1b013dbce..00000000000 --- a/usr.bin/learn/lib/editor/L15.2c +++ /dev/null @@ -1,19 +0,0 @@ -#print -Note that every set of lines to be appended ends -with the character '.' alone on a line. This is essential -to get back to editor command level. Whenever you have -been appending, and you later type a 'p' or 'w' command -and the editor appears not to respond, check that you -remember to type the '.' to stop appending. This is a very -common error even among experienced users. Suppose you type -in, appending to a file, five lines; what must you type on -the sixth line before typing 'w'? Type "answer X" where X -is that character. -#copyin -#user -#uncopyin -#match . -#log -#next -15.2d 5 -15.3d 2 diff --git a/usr.bin/learn/lib/editor/L15.2d b/usr.bin/learn/lib/editor/L15.2d deleted file mode 100644 index a8c6f77ca23..00000000000 --- a/usr.bin/learn/lib/editor/L15.2d +++ /dev/null @@ -1,19 +0,0 @@ -#print -As we mentioned, you can add several lines at once. Here is -a set of lines; go into the editor, append them, write them -on a file named "fruit", and then leave the editor and -type "ready". -#create Ref -apple -peach -pear -plum -nectarine -orange -#print Ref -#user -#cmp Ref fruit -#log -#next -16.1a 10 -15.3e 5 diff --git a/usr.bin/learn/lib/editor/L15.3b b/usr.bin/learn/lib/editor/L15.3b deleted file mode 100644 index b7f93e4382b..00000000000 --- a/usr.bin/learn/lib/editor/L15.3b +++ /dev/null @@ -1,25 +0,0 @@ -#print -You can put several lines betwen the 'a' and the '.', as -in this example which creates a file named 'opera'. - ed opera - a - abduction from the seraglio - mozart - aida - verdi - alcina - handel - anna bolena - donizetti - . - w - q -Try this as shown. Then type "ready". -(Notice the warning that "opera" doesn't exist -when you start.) -#create Ref -abduction from the seraglio - mozart -aida - verdi -alcina - handel -anna bolena - donizetti -#user -#cmp opera Ref -#log -#next -15.2c 5 diff --git a/usr.bin/learn/lib/editor/L15.3d b/usr.bin/learn/lib/editor/L15.3d deleted file mode 100644 index 49bae05564b..00000000000 --- a/usr.bin/learn/lib/editor/L15.3d +++ /dev/null @@ -1,14 +0,0 @@ -#print -Use the editor to make a file named 'pres' and containing -the single line - -franklin delano roosevelt - -and then type "ready". -#create Ref -franklin delano roosevelt -#user -#cmp pres Ref -#log -#next -15.3e 5 diff --git a/usr.bin/learn/lib/editor/L15.3e b/usr.bin/learn/lib/editor/L15.3e deleted file mode 100644 index 714d78a6679..00000000000 --- a/usr.bin/learn/lib/editor/L15.3e +++ /dev/null @@ -1,16 +0,0 @@ -#print -Remember that after typing the '.' which ends an append -you can type ordinary commands at the editor. Go into -the editor; append the line - -washington, d.c. - -and then print it with the 'p' command. Then write it -on a file named "city" and leave the editor and type "ready". -#create Ref -washington, d.c. -#user -#cmp city Ref -#log -#next -15.3f 5 diff --git a/usr.bin/learn/lib/editor/L15.3f b/usr.bin/learn/lib/editor/L15.3f deleted file mode 100644 index 29020cd2dd2..00000000000 --- a/usr.bin/learn/lib/editor/L15.3f +++ /dev/null @@ -1,20 +0,0 @@ -#print -Now make a file named "towns" that contains the lines -summit -chatham -westfield -cranford -madison -and print it out to check you did it right. -Then type "ready". -#create Ref -summit -chatham -westfield -cranford -madison -#user -#cmp towns Ref -#log -#next -16.1a 10 diff --git a/usr.bin/learn/lib/editor/L16.1a b/usr.bin/learn/lib/editor/L16.1a deleted file mode 100644 index ca51bfca3fb..00000000000 --- a/usr.bin/learn/lib/editor/L16.1a +++ /dev/null @@ -1,36 +0,0 @@ -#print -When you are typing after an 'append' command, -the editor is no longer listening for its ordinary -commands. Between 'a' and '.' none of your -usual 'p', 'w', or 'q' commands are recognized. The only -thing that will make the editor wake up is to type '.' -alone on a line. So to type in text, then print it, -you must go through a sequence like - ed file - a - input text - . - 1,$p - w - q -and you must not type the "1,$p" until you have typed -the '.'. Do you understand? Will the sequence - ed junk - a - input line - $= - . - w - q -print the number of the last line typed in? If you don't -know, try it. Then type 'yes' or 'no'. -#copyin -#pipe -#user -#unpipe -#uncopyin -#match no -#log -#next -16.1b 10 -16.2a 5 diff --git a/usr.bin/learn/lib/editor/L16.1b b/usr.bin/learn/lib/editor/L16.1b deleted file mode 100644 index 776bd62b426..00000000000 --- a/usr.bin/learn/lib/editor/L16.1b +++ /dev/null @@ -1,21 +0,0 @@ -#print -So far you've only appended to empty files. If the file -you are appending to has something in it, you have to -decide where you want the new material to be placed. -You can give a line address with 'a', and the append -command will place the new material after that line. -For example, - 3a - input - . -places 'input' after line 3. What will be the line -number of the input line? Type 'answer N', as usual. -#pipe -#copyin -#user -#uncopyin -#unpipe -#match 4 -#log -#next -16.1c 10 diff --git a/usr.bin/learn/lib/editor/L16.1c b/usr.bin/learn/lib/editor/L16.1c deleted file mode 100644 index 86dfcbe3a65..00000000000 --- a/usr.bin/learn/lib/editor/L16.1c +++ /dev/null @@ -1,39 +0,0 @@ -#print -The current directory contains a file -named 'hand'. The third line is missing: -add the line - -middle finger - -after line 2 of this file. -Check what you're doing by printing the file -with - 1,$p -before and after the change. -Then rewrite the file with the usual w, q, -and then type "ready". -#create Ref -thumb -index finger -middle finger -ring finger -little finger -#create hand -thumb -index finger -ring finger -little finger -#create rhand -thumb -index finger -ring finger -little finger -#pipe -#user -#unpipe -#cmp hand Ref -#log -#next -17.2a 5 -18.1a 10 -18.2a 7 diff --git a/usr.bin/learn/lib/editor/L16.2a b/usr.bin/learn/lib/editor/L16.2a deleted file mode 100644 index f5121add08d..00000000000 --- a/usr.bin/learn/lib/editor/L16.2a +++ /dev/null @@ -1,41 +0,0 @@ -#print -So far you have always appended to an empty file, -so that there was no problem about where the appended lines -were placed in the file. If the file you're appending to -already has lines in it, you can say where you want the -new material to be placed by giving a line address with 'a', -and you can check on this by printing the file. -Try the following sequence and note what happens to the new lines -that are added with the "3a" command: - -ed rivers -1,$p -3a -merrimack -connecticut -hudson -. -1,$p -w -q -ready -#create Ref -penobscot -androscoggin -kennebec -merrimack -connecticut -hudson -delaware -susquehanna -#create rivers -penobscot -androscoggin -kennebec -delaware -susquehanna -#user -#cmp rivers Ref -#log -#next -16.2c 5 diff --git a/usr.bin/learn/lib/editor/L16.2c b/usr.bin/learn/lib/editor/L16.2c deleted file mode 100644 index 8a345a229a0..00000000000 --- a/usr.bin/learn/lib/editor/L16.2c +++ /dev/null @@ -1,14 +0,0 @@ -#print -You can see that the 'a' command adds lines after the -line addressed. So if you type - 2a -at the editor, what will be the line number of the -first line that you added? Type "answer N" where N is the -number it will have. -#copyin -#user -#uncopyin -#match 3 -#log -#next -16.1c 5 diff --git a/usr.bin/learn/lib/editor/L17.2a b/usr.bin/learn/lib/editor/L17.2a deleted file mode 100644 index 5d6332b9ab1..00000000000 --- a/usr.bin/learn/lib/editor/L17.2a +++ /dev/null @@ -1,14 +0,0 @@ -#print -You must always remember what the computer is expecting -from you: shell commands, editor commands, or input -text after an 'append'. Suppose you are -typing append text: what do you type to get -back to where you can type editor commands? Type -"answer X" where "X" is replaced by what you type. -#copyin -#user -#uncopyin -#match . -#log -#next -17.2b 5 diff --git a/usr.bin/learn/lib/editor/L17.2b b/usr.bin/learn/lib/editor/L17.2b deleted file mode 100644 index 78b480fd04a..00000000000 --- a/usr.bin/learn/lib/editor/L17.2b +++ /dev/null @@ -1,12 +0,0 @@ -#print -What do you type to go from -the editor command level to where -you type input text? (The append command). -Type "answer X" where X is what you type. -#copyin -#user -#uncopyin -#match a -#log -#next -17.2c 5 diff --git a/usr.bin/learn/lib/editor/L17.2c b/usr.bin/learn/lib/editor/L17.2c deleted file mode 100644 index bf0351be6fe..00000000000 --- a/usr.bin/learn/lib/editor/L17.2c +++ /dev/null @@ -1,12 +0,0 @@ -#print -What command do you type to go from the -shell to the editor? Type "answer X" where -X is the command name. -#copyin -#user -#uncopyin -#match e -#match ed -#log -#next -17.2d 5 diff --git a/usr.bin/learn/lib/editor/L17.2d b/usr.bin/learn/lib/editor/L17.2d deleted file mode 100644 index 0d38499f535..00000000000 --- a/usr.bin/learn/lib/editor/L17.2d +++ /dev/null @@ -1,12 +0,0 @@ -#print -And, finally, what is the last line you type -to go to the shell from the editor? Again, respond -"answer X" where X is the command. -#copyin -#user -#uncopyin -#match q -#log -#next -18.1a 10 -18.2a 5 diff --git a/usr.bin/learn/lib/editor/L18.1a b/usr.bin/learn/lib/editor/L18.1a deleted file mode 100644 index 488a804ec15..00000000000 --- a/usr.bin/learn/lib/editor/L18.1a +++ /dev/null @@ -1,40 +0,0 @@ -#print -Sometimes it is desirable to add text before a -known line, rather than after it. For this purpose -there is an 'i' (insert) command that places the new -material before the specified line. Otherwise, 'i' -is exactly like 'a', so that - 3i -is the same as - 2a -Remember the address of the last line? Just -before the last line of file 'airlines' -insert the line - -twa - -and then rewrite the file with w, q, and type ready. -#create Ref -american -braniff -continental -delta -eastern -national -pan am -twa -united -#create airlines -american -braniff -continental -delta -eastern -national -pan am -united -#user -#cmp airlines Ref -#log -#next -19.1a 10 diff --git a/usr.bin/learn/lib/editor/L18.2a b/usr.bin/learn/lib/editor/L18.2a deleted file mode 100644 index dafb343cd45..00000000000 --- a/usr.bin/learn/lib/editor/L18.2a +++ /dev/null @@ -1,42 +0,0 @@ -#print -Once in a while you want to add text just before -a certain line, rather than just after it. For this purpose -there is a command 'i' (insert) which is just like 'a' -except that the new material goes before the addressed line, -instead of after it. For example, - 3i -is the same as - 2a -Try this sequence, which prints the editor buffer before -and after the insertion, to see what happens. - -ed cars -1,$p -3i -lincoln -chevrolet -. -1,$p -w -q -ready -#create Ref -ford -mercury -lincoln -chevrolet -buick -pontiac -oldsmobile -#create cars -ford -mercury -buick -pontiac -oldsmobile -#user -#cmp cars Ref -#log -#next -18.2c 7 -18.3a 3 diff --git a/usr.bin/learn/lib/editor/L18.2c b/usr.bin/learn/lib/editor/L18.2c deleted file mode 100644 index 5a4bc25ffd1..00000000000 --- a/usr.bin/learn/lib/editor/L18.2c +++ /dev/null @@ -1,15 +0,0 @@ -#print -Again, remembering that "5i" is the same as "4a" -what command is the same as - .-1a -to the editor? Respond "answer XX" where XX is that -command. -#copyin -#user -#uncopyin -#match i -#match .i -#log -#next -18.2d 2 -18.2e 6 diff --git a/usr.bin/learn/lib/editor/L18.2d b/usr.bin/learn/lib/editor/L18.2d deleted file mode 100644 index 6da3437aeef..00000000000 --- a/usr.bin/learn/lib/editor/L18.2d +++ /dev/null @@ -1,11 +0,0 @@ -#print -What command will insert lines before the second line from the -end of the file? Type "answer XXX" where XXX is that command. -#copyin -#user -#uncopyin -#match $-2i -#match $-3a -#log -#next -18.2e 5 diff --git a/usr.bin/learn/lib/editor/L18.2e b/usr.bin/learn/lib/editor/L18.2e deleted file mode 100644 index fd06297bb01..00000000000 --- a/usr.bin/learn/lib/editor/L18.2e +++ /dev/null @@ -1,33 +0,0 @@ -#print -Just before the last line of file 'airlines' -in this directory insert the line - -twa - -and then rewrite the file with w, q, and -type "ready". -#create Ref -american -braniff -continental -delta -eastern -national -pan am -twa -united -#create airlines -american -braniff -continental -delta -eastern -national -pan am -united -#user -#cmp airlines Ref -#log -#next -19.1a 10 -19.2a 5 diff --git a/usr.bin/learn/lib/editor/L18.3a b/usr.bin/learn/lib/editor/L18.3a deleted file mode 100644 index 3b6378d6e99..00000000000 --- a/usr.bin/learn/lib/editor/L18.3a +++ /dev/null @@ -1,13 +0,0 @@ -#print -Since 'i' is the same as 'a' except for the position -of the inserted material, what character must end -every block of lines inserted with the 'i' command? -Type "answer X" where X is that character. -#copyin -#user -#uncopyin -#match . -#log -#next -18.3b 5 -18.2c 10 diff --git a/usr.bin/learn/lib/editor/L18.3b b/usr.bin/learn/lib/editor/L18.3b deleted file mode 100644 index 2656f6de480..00000000000 --- a/usr.bin/learn/lib/editor/L18.3b +++ /dev/null @@ -1,18 +0,0 @@ -#print -Remembering that 'i' inserts one line before -the 'a' command, so that after - 3a -the first input line is number 4 while after - 3i -the first input line is number 3, what command -using 'i' is the same as the command - 5a -to the editor? Type "answer XX" where XX is that -command. -#copyin -#user -#uncopyin -#match 6i -#log -#next -18.2c 5 diff --git a/usr.bin/learn/lib/editor/L19.1a b/usr.bin/learn/lib/editor/L19.1a deleted file mode 100644 index 7d83c3ba7e6..00000000000 --- a/usr.bin/learn/lib/editor/L19.1a +++ /dev/null @@ -1,42 +0,0 @@ -#print -Now that you know how to add lines to a file, -you will want to know how to get rid of them. -The command - 5d -will delete line 5 of a file. The command - .d -will delete the current line. -In the file 'pres' either the 5th or 6th line -is wrong. Print those lines and delete the bad -one; then rewrite the corrected file. -Then type 'ready'. -#create Ref -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -andrew jackson -martin van buren -william henry harrison -john tyler -#create pres -george washington -john adams -thomas jefferson -james madison -james monroe - this is wrong Qwertyuiop -john quincy adams -andrew jackson -martin van buren -william henry harrison -john tyler -#pipe -#user -#unpipe -#cmp pres Ref -#log -#next -19.1b 10 diff --git a/usr.bin/learn/lib/editor/L19.1b b/usr.bin/learn/lib/editor/L19.1b deleted file mode 100644 index 3fd0369da4d..00000000000 --- a/usr.bin/learn/lib/editor/L19.1b +++ /dev/null @@ -1,41 +0,0 @@ -#print -Just as you can print several lines at once by -giving a range of addresses with the 'p' command, -you can delete several lines at once by giving -two addresses. For example, - 2,5d -deletes lines 2, 3, 4 and 5 of the current file. The -command - 1,.-1d -deletes all lines up to but not including the current line. -And - 1,$d -deletes EVERY line. (Use with extreme caution, obviously.) -There is a file named 'counties' in this directory. -Throw away the first five lines of it and rewrite it. -Then type 'ready' as usual. -#create Ref -Morris -Warren -Union -Somerset -Hunterdon -#create counties -Bergen -Passaic -Sussex -Hudson -Essex -Morris -Warren -Union -Somerset -Hunterdon -#pipe -#user -#unpipe -#cmp counties Ref -#log -#next -20.1a 10 -20.2a 5 diff --git a/usr.bin/learn/lib/editor/L19.2a b/usr.bin/learn/lib/editor/L19.2a deleted file mode 100644 index 263d6b086d9..00000000000 --- a/usr.bin/learn/lib/editor/L19.2a +++ /dev/null @@ -1,42 +0,0 @@ -#print -To avoid just accumulating lines forever, you need some -way of getting rid of them. The 'd' command (delete) removes -lines you don't want. Since it also removes lines that -you do want if you tell it to, you should be careful -with this command. Deleting one line at a time -is always pretty safe. For example - 5d -will delete line 5 of a file. Try the following -sequence; note that I've used "cat" -for a change. - -cat bmt -ed bmt -5d -w -q -cat bmt -ready -#create Ref -14th st -23rd st -28th st -34th st -times square -49th st -57th st -#create bmt -14th st -23rd st -28th st -34th st -42nd st -times square -49th st -57th st -#user -#cmp bmt Ref -#log -#next -19.3b 3 -19.2c 8 diff --git a/usr.bin/learn/lib/editor/L19.2c b/usr.bin/learn/lib/editor/L19.2c deleted file mode 100644 index cabcce8863a..00000000000 --- a/usr.bin/learn/lib/editor/L19.2c +++ /dev/null @@ -1,34 +0,0 @@ -#print -In this directory there is a file "pres" in which -either the 5th line or the 6th line does not -belong. Edit the file, print the dubious lines, -delete the bad one, and then rewrite the file. -Then type "ready". -#create Ref -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -andrew jackson -martin van buren -william henry harrison -john tyler -#create pres -george washington -john adams -thomas jefferson -james madison -james monroe - this is wrong Qwertyuiop -john quincy adams -andrew jackson -martin van buren -william henry harrison -john tyler -#user -#cmp pres Ref -#log -#next -19.2d 5 diff --git a/usr.bin/learn/lib/editor/L19.2d b/usr.bin/learn/lib/editor/L19.2d deleted file mode 100644 index c9207ac60df..00000000000 --- a/usr.bin/learn/lib/editor/L19.2d +++ /dev/null @@ -1,36 +0,0 @@ -#print -You can delete several lines at once by giving a range -of addresses with the 'd' command. For example, the sequence - -ed howto -2,5d -w -q - -will delete lines 2 through 5 of the file "howto" and write -the shorter material on the file "new". Try that. Then say - -cat howto -cat new - -to see the differences; then type "ready". -#create Ref -To use UNIX: -5. dial ext. 4321 -6. type userid in response to login -7. type commands -#create howto -To use UNIX: -1. turn terminal power on -2. check terminal is in "line" mode -3. check duplex switch in "full" position -4. check baud rate at "300" -5. dial ext. 4321 -6. type userid in response to login -7. type commands -#user -#cmp new Ref -#log -#next -19.2e 5 -20.1a 10 diff --git a/usr.bin/learn/lib/editor/L19.2e b/usr.bin/learn/lib/editor/L19.2e deleted file mode 100644 index 3253fcc67ef..00000000000 --- a/usr.bin/learn/lib/editor/L19.2e +++ /dev/null @@ -1,30 +0,0 @@ -#print -Now, for comparison, use the "diff" command to -check on the differences between "howto" and "new". -Try typing - -diff howto new - -and then "ready". -#create howto -To use UNIX: -1. turn terminal power on -2. check terminal is in "line" mode -3. check duplex switch in "full" position -4. check baud rate at "300" -5. dial ext. 4321 -6. type userid in response to login -7. type commands -#create new -To use UNIX: -5. dial ext. 4321 -6. type userid in response to login -7. type commands -#copyin -#user -#uncopyin -#match diff howto new -#match diff new howto -#log -#next -19.2f diff --git a/usr.bin/learn/lib/editor/L19.2f b/usr.bin/learn/lib/editor/L19.2f deleted file mode 100644 index 0a2b6c96f0a..00000000000 --- a/usr.bin/learn/lib/editor/L19.2f +++ /dev/null @@ -1,27 +0,0 @@ -#print -There is a file "counties" in this directory. -Try deleting the first five lines of the file. -Then type "ready". -#create Ref -Morris -Warren -Union -Somerset -Hunterdon -#create counties -Bergen -Passaic -Sussex -Hudson -Essex -Morris -Warren -Union -Somerset -Hunterdon -#user -#cmp counties Ref -#log -#next -20.1a 10 -20.2a 5 diff --git a/usr.bin/learn/lib/editor/L19.3b b/usr.bin/learn/lib/editor/L19.3b deleted file mode 100644 index 6b6a676e180..00000000000 --- a/usr.bin/learn/lib/editor/L19.3b +++ /dev/null @@ -1,32 +0,0 @@ -#print -You can use any other kind of address you want -with 'd'; for example, - .d -will delete the current line. Remember the -name of the last line? Pick up file -"flower" and delete the last line and -rewrite the file. Then type "ready". -#create Ref -aster -chrysanthemum -daffodil -marigold -petunia -rose -tulip -zinnia -#create flower -aster -chrysanthemum -daffodil -marigold -petunia -rose -tulip -zinnia -hummingbird -#user -#cmp flower Ref -#log -#next -19.2c 10 diff --git a/usr.bin/learn/lib/editor/L2.1a b/usr.bin/learn/lib/editor/L2.1a deleted file mode 100644 index 387c70e2c01..00000000000 --- a/usr.bin/learn/lib/editor/L2.1a +++ /dev/null @@ -1,14 +0,0 @@ -#print -Now to check that you can type, a line will -be typed at you: type it back in, and then type "ready". -Type the line exactly as it is typed at you, including -the colons that bracket it. - -: pack my box with five dozen liquor jugs : -#copyin -#user -#uncopyin -#match : pack my box with five dozen liquor jugs : -#log -#next -3.1a 10 diff --git a/usr.bin/learn/lib/editor/L2.2a b/usr.bin/learn/lib/editor/L2.2a deleted file mode 100644 index c25bc1037f1..00000000000 --- a/usr.bin/learn/lib/editor/L2.2a +++ /dev/null @@ -1,11 +0,0 @@ -#print -As an easier typing test, see if you can just get -the word "management" in correctly. Type it -in response to "$" and then type "ready". -#copyin -#user -#uncopyin -#match management -#log -#next -3.1a 10 diff --git a/usr.bin/learn/lib/editor/L20.1a b/usr.bin/learn/lib/editor/L20.1a deleted file mode 100644 index d2aa4f43e04..00000000000 --- a/usr.bin/learn/lib/editor/L20.1a +++ /dev/null @@ -1,46 +0,0 @@ -#print -You can now change a line of a file, using only the -commands already taught, by deleting the old line -and inserting a new one. -This is not a very convenient way to do that, so -there is a command 'c' (change) which combines -those operations. - 5c - input text - here. - . -will delete line 5 and replace it by the lines - -input text -here. - -Note that the text following 'c', just like the text -after 'i' and 'a', must end with a line containing just -one '.' and nothing else. -This directory contains a file named 'short' -with six lines in it. Change the last line to read - -new version of last line - -and rewrite the file; then end with "ready". -#create Ref -This is a short file -which contains exactly -six lines of text -of which you are -to change the last line -new version of last line -#create short -This is a short file -which contains exactly -six lines of text -of which you are -to change the last line -this is the last line. -#pipe -#user -#unpipe -#cmp Ref short -#log -#next -21.1a 10 diff --git a/usr.bin/learn/lib/editor/L20.2a b/usr.bin/learn/lib/editor/L20.2a deleted file mode 100644 index 58ba72f3e65..00000000000 --- a/usr.bin/learn/lib/editor/L20.2a +++ /dev/null @@ -1,30 +0,0 @@ -#print -You can now change a line of a file by a slow procedure: delete the -old version and insert the new one. For example, you could replace -line 4 of a file with - 4d - 3a - new version of line 4 - . -right? OK, try that. There is a file named "words" in this -directory and line 4 contains a mistyped word. Correct it and -rewrite the file; then type "ready". -#create Ref -bear -begin -belief -believe -belt -bend -#create words -bear -begin -belief -beleive -belt -bend -#user -#cmp words Ref -#log -#next -20.2b 5 diff --git a/usr.bin/learn/lib/editor/L20.2b b/usr.bin/learn/lib/editor/L20.2b deleted file mode 100644 index 0c361b561cd..00000000000 --- a/usr.bin/learn/lib/editor/L20.2b +++ /dev/null @@ -1,40 +0,0 @@ -#print -There is an easier way to do that. You can just say - 5c - input text for new version - . -using the 'c' command ('c' stands for 'change') which -will delete the old version of the line and -replace it. Note that the input text after 'c' ends -with a '.' just like the text after the 'a' or 'i' commands. -This directory contains a file named "lineup". Change -the third line to read "neal walk" and print the file -before and after. Use a sequence like this, ending in ready: - -ed lineup -1,$p -3c -neal walk -. -1,$p -w -q -ready - -#create Ref -walt frazier -earl monroe -neal walk -bill bradley -spencer haywood -#create lineup -walt frazier -earl monroe -john gianelli -bill bradley -spencer haywood -#user -#cmp lineup Ref -#log -#next -20.2c 5 diff --git a/usr.bin/learn/lib/editor/L20.2c b/usr.bin/learn/lib/editor/L20.2c deleted file mode 100644 index 35055bf3c5e..00000000000 --- a/usr.bin/learn/lib/editor/L20.2c +++ /dev/null @@ -1,58 +0,0 @@ -#print -You can also change several lines, and you need not replace -lines with the same number of lines. You can put any amount -of text between the 'c' command and the closing '.', and -you can remove any number of lines from the file by specifying -a range of addresses. For example, - - 2,5c - first - second - . -would replace the FOUR lines 2,3,4 and 5 of the file with TWO -new lines containing "first" and "second". You can of course -use more complicated addresses involving $ and . if you wish. -This directory contains a file "oldrr". Delete the last two -lines and replace them by a line reading - -penn central - -and write the new version on a file named "newrr". Then use "diff" -to compare the old and new versions of the file. -Eventually, type "ready". -#create Ref -maine central -bangor and aroostook -boston and maine -grand trunk -vermont central -boston and albany -new haven -delaware and hudson -new york, susquehanna, and western -erie-lackawanna -chessie system -lehigh valley -long island railroad -penn central -#create oldrr -maine central -bangor and aroostook -boston and maine -grand trunk -vermont central -boston and albany -new haven -delaware and hudson -new york, susquehanna, and western -erie-lackawanna -chessie system -lehigh valley -long island railroad -new york central -pennsylvania -#user -#cmp newrr Ref -#log -#next -21.1a 10 diff --git a/usr.bin/learn/lib/editor/L21.1a b/usr.bin/learn/lib/editor/L21.1a deleted file mode 100644 index d4785d6328c..00000000000 --- a/usr.bin/learn/lib/editor/L21.1a +++ /dev/null @@ -1,17 +0,0 @@ -#print -Remember all the basic commands: 'e', 'a', 'w' and 'q'. -Make a file named 'test' that contains the following lines, exactly -as presented below. Then type "ready". -#create Ref -maine -new hampshire -vermont -massachusetts -rhode island -connecticut -#print Ref -#user -#cmp Ref test -#log -#next -21.1b 5 diff --git a/usr.bin/learn/lib/editor/L21.1b b/usr.bin/learn/lib/editor/L21.1b deleted file mode 100644 index 3f6d5a27e68..00000000000 --- a/usr.bin/learn/lib/editor/L21.1b +++ /dev/null @@ -1,27 +0,0 @@ -#print -In this directory there is a file 'fix'. It contains -a mistyped line. Print the file; then change that -line and rewrite the file correctly. -Then type "ready". -#create Ref -Bell System Companies include: -American Telephone and Telegraph Company - Long Lines Division -Western Electric Company -Bell Laboratories -Teletype Corporation -Associated Companies -#create fix -Bell System Companies include: -American Telephone and Telegraph Company - Long Lines Division -Western Electric Company -Bell Lxxxxtories -Teletype Corporation -Associated Companies -#user -#cmp Ref fix -#log -#next -21.1c 5 -21.1e 10 diff --git a/usr.bin/learn/lib/editor/L21.1c b/usr.bin/learn/lib/editor/L21.1c deleted file mode 100644 index 0ea6579497d..00000000000 --- a/usr.bin/learn/lib/editor/L21.1c +++ /dev/null @@ -1,87 +0,0 @@ -#print -This directory contains a file "list" which has -a list of words in it. What word is on the last line -of the file? The file is rather long - I'd suggest you -not try to print all of it. Type "answer WORD" where -WORD is the word on the last line of the file. -#create list -aardvark -adapt -addition -alert -allege -alphabet -announce -answer -apple -architect -arrange -avoid -this -is -going -to -be -very -boring -if -you -keep -trying -to -print -the -whole -file -you -should -have -said -$p -and -I -would -suggest -you -hit -delete -now -and -try -that -instead -i -am -very -patient -and -you -are -not -going -to -like -waiting -for -all -of -this -to -go -on -for -ver -... -... -.. -... -year -youth -zebra -#copyin -#user -#uncopyin -#match zebra -#log -#next -21.1d 5 diff --git a/usr.bin/learn/lib/editor/L21.1d b/usr.bin/learn/lib/editor/L21.1d deleted file mode 100644 index 4b7d67340f4..00000000000 --- a/usr.bin/learn/lib/editor/L21.1d +++ /dev/null @@ -1,446 +0,0 @@ -#print -How long is file "text"? (That is, -how many lines does it have, or what -is the line number of the last line.) Remember the -"=" command? This file is also too long for you -to print out in full. -Type "answer N" where N is the number of the last -line. -#create text -a -able -about -above -absolutely -accidents -act -add -administered -admiration -adoring -advancing -adventure -advised -after -afternoon -afterward -again -against -agent -alacrity -all -allow -almost -alone -along -alongside -alp-climbers -alpenstock -alpine -alps -already -also -alter -although -am -among -an -and -animal -animals -another -anxiety? -any -apparent -applause -appointed -appreciation -are -argued -armor-bearers -around -arrange -arrived -article -as -ascend -ascending -ascent -aside -asked -assailed -assaulting -assembled -assist -at -attempt -attended -attention -attracted -avalanches -away -awful -back -badly -baffled -barometer -barrier -battered -battle -be -beautiful -because -become -bed -been -before -began -beginning -behind -being -believed -beneficent -better -between -big -bitter -black -blue -book -both -boughs -brass -break -breast -breath -bridge -bringing -broke -broken -brought -burdens -burst -but -by -called -calmly -came -can -cannot -caravan -carpeted -carried -case -catch -caught -caused -cavalcade -ceased -cellar -center -certainly -chair -chance -change -chaplain -cheered -chief -chilly -church -circumstance -citizens -civilization -clear -clearly -climb -climber -clock -closed -clove -coil -cold -column -comfort -command -commanded -commended -concluded -condition -confronted -consequently -considerable -considered -consisted -constantly -consulting -contrived -convinced -cord -could -country -couple -courage -course -cover -covered -cows -crash -crawling -crept -crippling -crossed -crowd -crowded -cruel -crumbly -crutches -custom -cut -danger -dangerous -dark -dead -deaf -dear -decided -decked -declared -deep -deeply -defective -demanded -demoralization -densely -deployed -descending -describe -desert -deserted -despair -despondency -detachment -detail -detailing -did -die -directly -dirt -disappear -disappeared -dismal -disposition -divert -do -doing -done -donkey -doom -down -draped -dressed -drooped -dull -dumb -during -eager -ear -ears -earth -earthquake -easy -eat -edelweiss -either -elephants -eleven -eloquence -embrace -encounter -end -ended -enough -entered -entirely -established -estimate -even -evening -events -ever -every -everybody -examine -exceeded -excellent -except -excess -exclaimed -excursions -executed -exhaustion -expected -expedition -experimenter -explained -explosion -extreme -eye -eyes -face -faces -fact -fagged -failed -fainted -fallen -false -far -fast -fastened -faster -fatal -father -fatigue -fear -feared -fearful -fears -feature -feel -feet -fell -fellow -fetch -feverishly -few -fifteen -filing -find -finer -firmly -first -five -five-pound -fixed -flank -foot -for -forest -forgotten -form -forth -forty-foot -forward -found -four -frantic -free -frequency -fresh -friend -frightened -from -front -frozen -full -furthest -fury -gave -gazing -general -gentle -get -give -glad -glanced -gliding -go -going -gone -good -got -grace -grand -gratifying -great -green -ground -grow -growing -guide -guides -guttered -had -half -half-mile -halt -hampered -hand -hands -happened -harder -hardly -harris -hat -hate -haunts -have -having -he -head -hear -heard -heavens -heavy -held -here -hesitated -high -hill -him -himself -his -hoist -hold -homes -hook -hook-rope -hoping -horns -host -hotel -hotels -hour -hours -how -hurry -huts -huzza -i -ice-ax -ice-axes -idea -if -implement -implements -imposing -impressive -impulse -in -inches -including -indignant -ingratitude -injured -innocent -inquiries? -inquiring -#copyin -#user -#uncopyin -tail -1 .copy >X1 -%s/../lcount <text >X2 -#cmp X1 X2 -#log -#next -21.1e 6 diff --git a/usr.bin/learn/lib/editor/L21.1e b/usr.bin/learn/lib/editor/L21.1e deleted file mode 100644 index 14ab446ceef..00000000000 --- a/usr.bin/learn/lib/editor/L21.1e +++ /dev/null @@ -1,33 +0,0 @@ -#print -This directory contains a file "abot" which -has an extra line (one line was typed twice). -Remove the extra line and rewrite the -file; then type "ready". This file is -fairly short. -#create Ref -seven qualities characterize the clod and seven the -wise man: the wise man does not speak before him -that is greater than he in wisdom; he does not -break into his fellow's speech; he is not in a rush to -reply; he asks what is relevant and replies to the -point; he speaks of first things first and of last -things last; of what he has not heard he says "I -have not heard"; and he acknowledges what is true. - and the opposites apply to the clod. -#create abot -seven qualities characterize the clod and seven the -wise man: the wise man does not speak before him -that is greater than he in wisdom; he does not -break into his fellow's speech; he is not in a rush to -break into his fellow's speech; he is not in a rush to -reply; he asks what is relevant and replies to the -point; he speaks of first things first and of last -things last; of what he has not heard he says "I -have not heard"; and he acknowledges what is true. - and the opposites apply to the clod. -#user -#cmp abot Ref -#log -#next -30.1a 10 -30.2a 5 diff --git a/usr.bin/learn/lib/editor/L3.1a b/usr.bin/learn/lib/editor/L3.1a deleted file mode 100644 index 2c8ea3d5d4e..00000000000 --- a/usr.bin/learn/lib/editor/L3.1a +++ /dev/null @@ -1,21 +0,0 @@ -#print -The editor accepts commands one per line, -just like the other programs in UNIX; but its -commands are unique to it. The -only command present in every editing session is the -last one, 'q' (quit) which returns to the normal -command interpreting program. I'm going to put -you in the editor. Type 'q' to leave, -and then type "ready" when you get the '$' from -the normal command handler. -#create junk -You're in the editor. -#pipe -ed - junk -1p -#user -#unpipe -#cmp junk junk -#log -#next -3.1b 5 diff --git a/usr.bin/learn/lib/editor/L3.1b b/usr.bin/learn/lib/editor/L3.1b deleted file mode 100644 index 3b1e9b80097..00000000000 --- a/usr.bin/learn/lib/editor/L3.1b +++ /dev/null @@ -1,37 +0,0 @@ -#print -A particularly important editor command -is 'w' (write). This writes whatever -you are working on, including everything you -have typed in or changed, into a file, -so that you can work on it again later. -If you try to quit from the editor without -writing out your changes, the editor will complain -(but only once -- a second 'q' will let you out). -Generally it's wisest to leave the editor by typing - -w -q - -rather than just 'q'. I'll put you in the editor; -type those two commands to leave. Then type -"ready". -#create bpres -Washington Adams Jefferson -#create pres -Washington Adams Jefferson -#pipe -ed pres -#user -#unpipe -#cmp pres bpres -#succeed -Note that the editor typed 27. This is the number -of characters it wrote into the file. This -is reassuring - it tells you the write was -successful. The count of characters read -is also typed, which is why you got a '27' -before your responses. -#log -#next -4.1a 10 -4.2a 5 diff --git a/usr.bin/learn/lib/editor/L30.1a b/usr.bin/learn/lib/editor/L30.1a deleted file mode 100644 index d0427376d53..00000000000 --- a/usr.bin/learn/lib/editor/L30.1a +++ /dev/null @@ -1,27 +0,0 @@ -#print -Although it is always possible to fix errors by retyping -the entire erroneous line with the 'c' command, it is -usually much faster to make small changes within -a line. The editor allows this with the 's' (substitute) -command. For example, - s/abc/def/ -will change a line previously reading - xxx abc -into one reading - xxx def -by replacing the string 'abc' in the line with the string 'def'. -In this directory is a file 'pres' with one line that says -'harry' where it should say 'george'. Fix it using the -substitute command to change 'harry' into 'george'. You -should use the 'p' command to print the line before and -after, checking that you did it correctly. Then -rewrite the file and type 'ready'. -#create Ref -george washington -#create pres -harry washington -#user -#cmp Ref pres -#log -#next -30.1b 10 diff --git a/usr.bin/learn/lib/editor/L30.1b b/usr.bin/learn/lib/editor/L30.1b deleted file mode 100644 index 65d65c4d6f1..00000000000 --- a/usr.bin/learn/lib/editor/L30.1b +++ /dev/null @@ -1,27 +0,0 @@ -#print -As with other commands, you can specify a line -number in front of the 's' command. Thus - 3s/x/a/ -will change the first 'x' to an 'a' on the third line -of the current file. Pick up file 'town' and -change the 'q' on the last line to a 'p'. Then -rewrite the file and type 'ready'. -#create Ref -south orange -maplewood -millburn -short hills -summit -new providence -#create town -south orange -maplewood -millburn -short hills -summit -new qrovidence -#user -#cmp town Ref -#log -#next -31.1a 10 diff --git a/usr.bin/learn/lib/editor/L30.2a b/usr.bin/learn/lib/editor/L30.2a deleted file mode 100644 index 6bccfcb92a8..00000000000 --- a/usr.bin/learn/lib/editor/L30.2a +++ /dev/null @@ -1,30 +0,0 @@ -#print -Changing a whole line with the 'c' command is a slow way -to work when you only want to change a few letters. The 's' (substitute) -command changes the letters within a line. For example, the command - s/abc/def/ -will change a line reading - xxxabc -into one reading - xxxdef -by replacing the string 'abc' with 'def'. Try the following sequence which -alters the first line of the file 'test' within this directory: - -ed test -1p -s/months/years/ -1p -w -q -ready -#create Ref -Four score and seven years ago our -fathers brought forth ... -#create test -Four score and seven months ago our -fathers brought forth ... -#user -#cmp test Ref -#log -#next -30.2b 5 diff --git a/usr.bin/learn/lib/editor/L30.2b b/usr.bin/learn/lib/editor/L30.2b deleted file mode 100644 index bf4edd6a89b..00000000000 --- a/usr.bin/learn/lib/editor/L30.2b +++ /dev/null @@ -1,17 +0,0 @@ -#print -In this directory is a file 'pres' whose first line says -'harry' where it should say 'george'. Fix it using the -substitute command to change 'harry' into 'george'. You should -use the 'p' command to print the line before and after, checking -that the change took place. Then rewrite the file and -type 'ready'. -#create Ref -george washington -#create pres -harry washington -#user -#cmp pres Ref -#log -#next -30.1b 10 -30.2c 5 diff --git a/usr.bin/learn/lib/editor/L30.2c b/usr.bin/learn/lib/editor/L30.2c deleted file mode 100644 index 1a5665031d1..00000000000 --- a/usr.bin/learn/lib/editor/L30.2c +++ /dev/null @@ -1,34 +0,0 @@ -#print -As with other commands, you can specify a line number -with the 's' command. Thus - 3s/x/a/ -will change the first 'x' on line 3 to an 'a'. Here is -a file "street" in which the fifth line has an 'r' -where it should have an 'a'. Try -the sequence - -ed street -5s/r/a/ -5p -w -q -ready -#create Ref -first avenue -second avenue -third avenue -lexington avenue -park avenue -madison avenue -#create street -first avenue -second avenue -third avenue -lexington avenue -prrk avenue -madison avenue -#user -#cmp street Ref -#log -#next -30.2d 5 diff --git a/usr.bin/learn/lib/editor/L30.2d b/usr.bin/learn/lib/editor/L30.2d deleted file mode 100644 index 1deb0b784e1..00000000000 --- a/usr.bin/learn/lib/editor/L30.2d +++ /dev/null @@ -1,18 +0,0 @@ -#print -In this directory is a file named "airport" -whose second line says "xx" where it should say -"ne". Edit the file, change those letters, and -rewrite the file. Then type "ready". -#create Ref -idlewild -newark -laguardia -#create airport -idlewild -xxwark -laguardia -#user -#cmp airport Ref -#log -#next -30.2e 5 diff --git a/usr.bin/learn/lib/editor/L30.2e b/usr.bin/learn/lib/editor/L30.2e deleted file mode 100644 index 7635883cdd3..00000000000 --- a/usr.bin/learn/lib/editor/L30.2e +++ /dev/null @@ -1,24 +0,0 @@ -#print -Now edit the file named "town" and change -the 'q' on the last line to a 'p'. Rewrite the -corrected file and type 'ready'. -#create Ref -south orange -maplewood -millburn -short hills -summit -new providence -#create town -south orange -maplewood -millburn -short hills -summit -new qrovidence -#user -#cmp town Ref -#log -#next -30.2f 5 -31.1a 10 diff --git a/usr.bin/learn/lib/editor/L30.2f b/usr.bin/learn/lib/editor/L30.2f deleted file mode 100644 index 20b2e507d6e..00000000000 --- a/usr.bin/learn/lib/editor/L30.2f +++ /dev/null @@ -1,22 +0,0 @@ -#print -Now there is a file named "equipment" -and on the next to last line is a word -that contains 'nn' where it should have 'mm'. -Fix it and rewrite the file. Then type "ready". -#create Ref -screwdriver -wrench -saw -hammer -pliers -#create equipment -screwdriver -wrench -saw -hanner -pliers -#user -#cmp equipment Ref -#log -#next -30.2g 5 diff --git a/usr.bin/learn/lib/editor/L30.2g b/usr.bin/learn/lib/editor/L30.2g deleted file mode 100644 index a32db4fc379..00000000000 --- a/usr.bin/learn/lib/editor/L30.2g +++ /dev/null @@ -1,24 +0,0 @@ -#print -This directory contains a file named "markets" which -has a 'q' on the last line where it should have a 'p'. -Rewrite the corrected version on a new file named -"nmark". Then type "ready". -#create Ref -shop-rite -acme -kings -a&p -finast -pathmark -#create markets -shop-rite -acme -kings -a&p -finast -qathmark -#user -#cmp nmark Ref -#log -#next -30.2h 5 diff --git a/usr.bin/learn/lib/editor/L30.2h b/usr.bin/learn/lib/editor/L30.2h deleted file mode 100644 index 5be2c4c1e1b..00000000000 --- a/usr.bin/learn/lib/editor/L30.2h +++ /dev/null @@ -1,27 +0,0 @@ -#print -The two files you were editing are still around here. -Use "diff" to see what the differences between them are -and check that the correction was made properly. Then -type "ready". -#create markets -shop-rite -acme -kings -a&p -finast -qathmark -#create nmark -shop-rite -acme -kings -a&p -finast -pathmark -#copyin -#user -#uncopyin -#match diff markets nmark -#match diff nmark markets -#log -#next -31.1a 10 diff --git a/usr.bin/learn/lib/editor/L31.1a b/usr.bin/learn/lib/editor/L31.1a deleted file mode 100644 index 10175ca2b58..00000000000 --- a/usr.bin/learn/lib/editor/L31.1a +++ /dev/null @@ -1,38 +0,0 @@ -#print -I hope you have been checking the effects of your -substitutions by using the 'p' command before and -after the changes. This is so often desired that -you may type the 'p' on the same line, after the 's' -command. Thus - s/ab/cd/p -changes 'ab' to 'cd' and prints the line after the change. -In this directory there is a file named 'tree'. Try changing -the fourth line, which now reads - spruxx -to read - spruce -and then rewrite the file, and type 'ready'. -#create Ref -pine -fir -hemlock -spruce -birch -beech -hickory -maple -#create tree -pine -fir -hemlock -spruxx -birch -beech -hickory -maple -#user -#cmp Ref tree -#log -#next -32.1a 10 -31.2b 5 diff --git a/usr.bin/learn/lib/editor/L31.2b b/usr.bin/learn/lib/editor/L31.2b deleted file mode 100644 index 264802a725f..00000000000 --- a/usr.bin/learn/lib/editor/L31.2b +++ /dev/null @@ -1,25 +0,0 @@ -#print -This directory contains a file "animal" which has -a mistyped line. Print the file, find the line, -fix the error using the 's' command, and then -rewrite the corrected file and type "ready". -#create Ref -cat -dog -raccoon -groundhog -mouse -mole -#create animal -cat -dog -rakkoon -groundhog -mouse -mole -#user -#cmp animal Ref -#log -#next -32.1a 10 -31.2c 5 diff --git a/usr.bin/learn/lib/editor/L31.2c b/usr.bin/learn/lib/editor/L31.2c deleted file mode 100644 index 4afa2dcb3ba..00000000000 --- a/usr.bin/learn/lib/editor/L31.2c +++ /dev/null @@ -1,32 +0,0 @@ -#print -In this directory there is a file "checks" -which contains 3 errors. Fix the spelling errors -and rewrite the file. Then type "ready". -#create Ref - The establishment of credit all over the civilized world made it -possible to develop new inventions, enlarge factories, produce more -goods so that more people could earn wages to buy them. Soon even -the supply of paper money would have been too small to take care of -the needs of business, had it not been for a new form of money. This -was the "check-book dollar." - There are now from 25 to 30 billion dollars in paper money -circulating in the United States. But that is only one tenth of -what is needed to do business every year. The other 90 per cent is -in the form of check-book dollars. -#create checks - The establishment of credit all over the civilized world made it -possible to develop new inventions, enlarge factories, produce more -goods so that more people could earn wages to buy them. Soon even -the supply of paper money would have been too smalp to take care of -the needs of businees, had it not been for a new form of money. This -was the "check-book dollar." - There are now from 25 to 30 billion dollars in paper money -circulating in txe United States. But that is only one tenth of -what is needed to do business every year. The other 90 per cent is -in the form of check-book dollars. -#user -#cmp checks Ref -#log -#next -32.1a 10 -32.2a 5 diff --git a/usr.bin/learn/lib/editor/L32.1a b/usr.bin/learn/lib/editor/L32.1a deleted file mode 100644 index 2e69407abab..00000000000 --- a/usr.bin/learn/lib/editor/L32.1a +++ /dev/null @@ -1,29 +0,0 @@ -#print -Just as you can specify files with an abbreviation, -it is also possible, in the 's' command, to -use an abbreviation for the string to be used -for substitution. Unfortunately, the characters -used to indicate an abbreviation are quite -different, and you must learn them separately for the -editor and the file-name interpreter. (Sorry about -that, but that's the way the world is.) - -The symbol for 'any character' is '.'. Thus - s/a./bc/p -looks for an 'a' followed by anything, and changes those -characters into 'bc'. -Thus the line - what now -would become - whbc now -after that command. -What will the word "floating" become after - s/a./or/ -is executed? Type "answer WORD" where WORD is the new version. -#copyin -#user -#uncopyin -#match flooring -#log -#next -32.1b 10 diff --git a/usr.bin/learn/lib/editor/L32.1b b/usr.bin/learn/lib/editor/L32.1b deleted file mode 100644 index 90067e729e5..00000000000 --- a/usr.bin/learn/lib/editor/L32.1b +++ /dev/null @@ -1,18 +0,0 @@ -#print -Note that the substitute command changes the first -instance of something that matches. Consider the -line - now is the time for all good men -and the substitute command - s/tim/TIM/ -applied to it. -Which word in the line will be altered by that command? -Type "answer WORD" where WORD is the word that will -be changed. -#copyin -#user -#uncopyin -#match time -#log -#next -32.1c 10 diff --git a/usr.bin/learn/lib/editor/L32.1c b/usr.bin/learn/lib/editor/L32.1c deleted file mode 100644 index 8bf4dc579d8..00000000000 --- a/usr.bin/learn/lib/editor/L32.1c +++ /dev/null @@ -1,16 +0,0 @@ -#print -Now, with the line - now is the time for all good men -and the command - s/t../TIM/p -what word will be changed? Again, type -"answer WORD"; remember that "." matches -any character, and the first match is picked. -#copyin -#user -#uncopyin -#match the -#log -#next -33.1a 10 -33.2a 5 diff --git a/usr.bin/learn/lib/editor/L32.2a b/usr.bin/learn/lib/editor/L32.2a deleted file mode 100644 index 73496b8a0bf..00000000000 --- a/usr.bin/learn/lib/editor/L32.2a +++ /dev/null @@ -1,32 +0,0 @@ -#print -Just as you can use abbreviations to specify a class of -filenames, you can use abbreviationss in the editor to recognize -strings in the substitute command. Unfortunately, the -characters used in the editor are quite different from the -ones used in the file-name handler to specify patterns. -(Sorry about that, but that's the way the world is.) - -The symbol for 'any character' is '.' and this will -match any single letter or other character in a line. -For example, - s/a./bc/ -looks for an 'a' followed by anything, and changes those -two letters into 'bc'. Try this sequence and note -what happens. - -ed line -p -s/a./bc/p -w -q -ready -#create Ref -me bcd you -#create line -me and you -#user -#cmp line Ref -#log -#next -32.2b 5 -32.2c 10 diff --git a/usr.bin/learn/lib/editor/L32.2b b/usr.bin/learn/lib/editor/L32.2b deleted file mode 100644 index 69d61cfd564..00000000000 --- a/usr.bin/learn/lib/editor/L32.2b +++ /dev/null @@ -1,14 +0,0 @@ -#print -Or, to take another example, the command - s/h./ar/ -would turn the word "that" into "tart": the '.' matches -the 'a'. What would that command change the -word "what" into? Reply "answer WORD" where WORD -is what the substitute command would produce. -#copyin -#user -#uncopyin -#match wart -#log -#next -32.2c 5 diff --git a/usr.bin/learn/lib/editor/L32.2c b/usr.bin/learn/lib/editor/L32.2c deleted file mode 100644 index fd9526511b4..00000000000 --- a/usr.bin/learn/lib/editor/L32.2c +++ /dev/null @@ -1,14 +0,0 @@ -#print -What will the word "floating" become after -the command - s/a./or/ -is executed? Type "answer WORD" where WORD is the -new version. -#copyin -#user -#uncopyin -#match flooring -#log -#next -32.2d 5 -32.1b 10 diff --git a/usr.bin/learn/lib/editor/L32.2d b/usr.bin/learn/lib/editor/L32.2d deleted file mode 100644 index f0c25984dd6..00000000000 --- a/usr.bin/learn/lib/editor/L32.2d +++ /dev/null @@ -1,11 +0,0 @@ -#print -Is the word "stop" changed by the command - s/to/xx/p -Type "yes" or "no". -#copyin -#user -#uncopyin -#match yes -#log -#next -32.2e 5 diff --git a/usr.bin/learn/lib/editor/L32.2e b/usr.bin/learn/lib/editor/L32.2e deleted file mode 100644 index 72bb0287389..00000000000 --- a/usr.bin/learn/lib/editor/L32.2e +++ /dev/null @@ -1,12 +0,0 @@ -#print -Is the word "stop" changed by the command - s/tp/xx/p -Type "yes" or "no". -#copyin -#user -#uncopyin -#match no -#log -#next -32.2f 5 -32.1b 10 diff --git a/usr.bin/learn/lib/editor/L32.2f b/usr.bin/learn/lib/editor/L32.2f deleted file mode 100644 index 5182018ccb8..00000000000 --- a/usr.bin/learn/lib/editor/L32.2f +++ /dev/null @@ -1,11 +0,0 @@ -#print -Is the word "stop" changed by the command - s/t./xx/p -Type "yes" or "no". -#copyin -#user -#uncopyin -#match yes -#log -#next -32.2g 5 diff --git a/usr.bin/learn/lib/editor/L32.2g b/usr.bin/learn/lib/editor/L32.2g deleted file mode 100644 index b31012c1bfb..00000000000 --- a/usr.bin/learn/lib/editor/L32.2g +++ /dev/null @@ -1,26 +0,0 @@ -#print -One place where "." is useful is in changing -letters that are hard to type, e.g. the # and @ -characters. For example, the command - s/a.b/xxx/ -will change "a#b" to "xxx". There is a file named -"goof" in this directory whose third line contains -the word - sp#xll -which should be "spell". Change it and rewrite the file; -then type "ready". -#create Ref -whoever typed this -either couldn't type -or couldn't spell -properly. -#create goof -whoever typed this -either couldn't type -or couldn't sp#xll -properly. -#user -#cmp goof Ref -#log -#next -32.1b 5 diff --git a/usr.bin/learn/lib/editor/L33.1a b/usr.bin/learn/lib/editor/L33.1a deleted file mode 100644 index 6b9a32aa77b..00000000000 --- a/usr.bin/learn/lib/editor/L33.1a +++ /dev/null @@ -1,20 +0,0 @@ -#print -When you want to match one of a few specific characters, and not -just any character, the pattern is similar to the pattern used -in filenames. The patterns used with the editor, by -the way, are called "regular expressions". The string - [abc] -matches 'a', 'b' or 'c'. So if the current line -is - now is the time for all good men -and the command is - s/t[ijk]/xx/ -what word is changed? Type "answer WORD" where WORD is the -word changed by that command. -#copyin -#user -#uncopyin -#match time -#log -#next -33.1b 10 diff --git a/usr.bin/learn/lib/editor/L33.1b b/usr.bin/learn/lib/editor/L33.1b deleted file mode 100644 index 83572235b8b..00000000000 --- a/usr.bin/learn/lib/editor/L33.1b +++ /dev/null @@ -1,24 +0,0 @@ -#print -Write the command that will change -either the word "that" or the word "than" -into "this", and then print the result. Type -"answer COMMAND" on a line, where COMMAND is -that string. (That is, COMMAND -will be of the form - s/.../.../p -where you have replaced the ... with the right stuff.) -You can test this out by going into the editor and -typing in a line that contains "that" and "than" -and trying to change it. You should do that until you -are sure you have the command right. -#copyin -#user -#uncopyin -#match s/tha[nt]/this/p -#match s/tha[tn]/this/p -#match s/tha[nt]/this/gp -#match s/tha[tn]/this/gp -#log -#next -34.1a 10 -34.2a 5 diff --git a/usr.bin/learn/lib/editor/L33.2a b/usr.bin/learn/lib/editor/L33.2a deleted file mode 100644 index ab451ec74bf..00000000000 --- a/usr.bin/learn/lib/editor/L33.2a +++ /dev/null @@ -1,27 +0,0 @@ -#print -When you want to match one of a few specific characters, -and not anything, the pattern is similar to that used in -file names. That is, - [abc] -matches the letters 'a', 'b', or 'c', but nothing -else. Try this sequence and note what happens: - -ed lines -1,$p -1s/[123]/9/ -2s/[123]/9/ -1,$p -w -q -ready -#create Ref -599 -948 -#create lines -519 -348 -#user -#cmp lines Ref -#log -#next -33.2b 5 diff --git a/usr.bin/learn/lib/editor/L33.2b b/usr.bin/learn/lib/editor/L33.2b deleted file mode 100644 index 260823553d7..00000000000 --- a/usr.bin/learn/lib/editor/L33.2b +++ /dev/null @@ -1,26 +0,0 @@ -#print -You can of course use the [] operators anywhere in -a pattern. Editor patterns, by the way, are called -"regular expressions". For example, suppose you wanted -to change either the word "trick" or the word "track" -to "stop". What command would you need? -Do you see that - - s/tr[ia]ck/stop/p - -will do that? Now figure out what command you would -need to change either "bear" or "beat" into "best" -and print the line after the change. -Type "answer COMMAND" where COMMAND is that line. -#copyin -#user -#uncopyin -#match s/bea[rt]/best/p -#match s/bea[tr]/best/p -#match s/bea[rt]/best/ -You forgot the "p" part. -#match s/bea[tr]/best/ -You forgot the "p" part. -#log -#next -33.2c 5 diff --git a/usr.bin/learn/lib/editor/L33.2c b/usr.bin/learn/lib/editor/L33.2c deleted file mode 100644 index f0bc9e07d32..00000000000 --- a/usr.bin/learn/lib/editor/L33.2c +++ /dev/null @@ -1,19 +0,0 @@ -#print -Suppose the current line is - -now is the time for all good men - -and you type the substitute command - -s/t[ijk]/xx/ - -what word is changed? Type "answer WORD" where -WORD is the word changed in the line. -#copyin -#user -#uncopyin -#match time -#log -#next -34.1a 10 -33.1b 5 diff --git a/usr.bin/learn/lib/editor/L34.1a b/usr.bin/learn/lib/editor/L34.1a deleted file mode 100644 index 2fd76d9387e..00000000000 --- a/usr.bin/learn/lib/editor/L34.1a +++ /dev/null @@ -1,17 +0,0 @@ -#print -You can also specify "all characters except ..." -using an expression of the form - [^ab] -which means "anything except an 'a' or 'b' character". -Will - s/ab[^cde]/xyz23/p -change - xbcabfgh -Type "yes" or "no". -#copyin -#user -#uncopyin -#match yes -#log -#next -34.1b 10 diff --git a/usr.bin/learn/lib/editor/L34.1b b/usr.bin/learn/lib/editor/L34.1b deleted file mode 100644 index 925143febd9..00000000000 --- a/usr.bin/learn/lib/editor/L34.1b +++ /dev/null @@ -1,19 +0,0 @@ -#print -Will the command - s/ab[^cde]/xx/p -change the line - abcxyzabfxyz -Type "yes" or "no". -#copyin -#user -#uncopyin -#match yes -#fail -Remember that the s/.../../ command will -keep looking through the line for something -to change, even if the beginning of the -line doesn't match. -#log -#next -35.1a 10 -35.2a 5 diff --git a/usr.bin/learn/lib/editor/L34.2a b/usr.bin/learn/lib/editor/L34.2a deleted file mode 100644 index b0b7b0236b2..00000000000 --- a/usr.bin/learn/lib/editor/L34.2a +++ /dev/null @@ -1,15 +0,0 @@ -#print -You can also specify "all characters except ..." -using an expression of the form - [^ab] -which means "any character except the letters 'a' or 'b'. -This is just like filename patterns again. Does - [^abc] -match the letter 'a'? Answer "yes" or "no". -#copyin -#user -#uncopyin -#match no -#log -#next -34.2b 5 diff --git a/usr.bin/learn/lib/editor/L34.2b b/usr.bin/learn/lib/editor/L34.2b deleted file mode 100644 index f143e0213a8..00000000000 --- a/usr.bin/learn/lib/editor/L34.2b +++ /dev/null @@ -1,11 +0,0 @@ -#print -Does - [^abc] -match the letter 'd'? Answer "yes" or "no". -#copyin -#user -#uncopyin -#match yes -#log -#next -34.2c 5 diff --git a/usr.bin/learn/lib/editor/L34.2c b/usr.bin/learn/lib/editor/L34.2c deleted file mode 100644 index e4c6506f818..00000000000 --- a/usr.bin/learn/lib/editor/L34.2c +++ /dev/null @@ -1,9 +0,0 @@ -#print -Does [abc] match 'a'? Answer "yes" or "no"? -#copyin -#user -#uncopyin -#match yes -#log -#next -34.2d 5 diff --git a/usr.bin/learn/lib/editor/L34.2d b/usr.bin/learn/lib/editor/L34.2d deleted file mode 100644 index 133ddb9e42b..00000000000 --- a/usr.bin/learn/lib/editor/L34.2d +++ /dev/null @@ -1,10 +0,0 @@ -#print -Does [^abc] match the '*' character? -Type "yes" or "no". -#copyin -#user -#uncopyin -#match yes -#log -#next -34.2e 5 diff --git a/usr.bin/learn/lib/editor/L34.2e b/usr.bin/learn/lib/editor/L34.2e deleted file mode 100644 index 681a3c6ea82..00000000000 --- a/usr.bin/learn/lib/editor/L34.2e +++ /dev/null @@ -1,22 +0,0 @@ -#print -Suppose you wanted to match all letters and -punctuation marks. You could try - [^ ] -which is "anything but blank". -Try the following commands: - -ed cut -1p -1s/p[^ ]/xxx/p -w -q -ready -#create Ref -stop this comxxxter -#create cut -stop this computer -#user -#cmp cut Ref -#log -#next -34.2f 5 diff --git a/usr.bin/learn/lib/editor/L34.2f b/usr.bin/learn/lib/editor/L34.2f deleted file mode 100644 index 0dfcca39cbe..00000000000 --- a/usr.bin/learn/lib/editor/L34.2f +++ /dev/null @@ -1,14 +0,0 @@ -#print -Will - s/ab[^cde]/xyz23/p -change - xbcabfgh -Type "yes" or "no". (Try it out -first in the editor if you don't know.) -#copyin -#user -#uncopyin -#match yes -#log -#next -34.1b 10 diff --git a/usr.bin/learn/lib/editor/L35.1a b/usr.bin/learn/lib/editor/L35.1a deleted file mode 100644 index 6ef8b47e403..00000000000 --- a/usr.bin/learn/lib/editor/L35.1a +++ /dev/null @@ -1,39 +0,0 @@ -#print -The "*" character is also used in substitute commands, -but it has a different meaning. Here it means -"any number of repetitions of the previous character". -(including zero!). Thus - a* -is any number of 'a' characters, and - [ab]* -is any number of either 'a' or 'b' characters. -So - s/ab*/xy/ -looks for an 'a' followed by any number of 'b' -letters, and will change - abbb cde -into - xy cde -You can use '*' after anything, including for example -blank. Thus - s/a */a/ -removes all the blanks after the letter 'a'. In this -directory there is a file 'text'. On the third line, -remove the blanks after the word 'the'. Then rewrite the -file and type "ready". -#create Ref -This is the file -for experimentation -with the(substitute) -command. -#create text -This is the file -for experimentation -with the (substitute) -command. -#user -#cmp text Ref -#log -#next -36.1a 10 -36.2a 5 diff --git a/usr.bin/learn/lib/editor/L35.2a b/usr.bin/learn/lib/editor/L35.2a deleted file mode 100644 index 474472c4a2a..00000000000 --- a/usr.bin/learn/lib/editor/L35.2a +++ /dev/null @@ -1,31 +0,0 @@ -#print -The '*' character is also used in the editor patterns (the regular -expressions) but it has quite a different meaning from '*' -as used in filenames. In the editor it means "any -number of repetitions of the previous character." Thus - a* -might match "a" or "aa" or "aaa" or "aaaa" and so on. -It might also match nothing, because "any number -of repetitions" includes "zero"! Perhaps it -will be clearer after you do the following example. -Note what happens to the two lines. Type - -ed file -1,2p -1s/xa*/xy/ -2s/xa*/xy/ -1,2p -w -q -ready -#create Ref -abxy -abxycd -#create file -abxaaa -abxcd -#user -#cmp file Ref -#log -#next -35.2b 5 diff --git a/usr.bin/learn/lib/editor/L35.2b b/usr.bin/learn/lib/editor/L35.2b deleted file mode 100644 index 91cc213f88f..00000000000 --- a/usr.bin/learn/lib/editor/L35.2b +++ /dev/null @@ -1,23 +0,0 @@ -#print -Now suppose we wanted to delete the blanks -after the letter "t" in this line: - -here are a lot of blanks - -This line is on file "blank". Try the sequence - -ed blank -1p -s/t */t/p -w -q -ready -#create Ref -here are a lotof blanks -#create blank -here are a lot of blanks -#user -#cmp blank Ref -#log -#next -35.2c 5 diff --git a/usr.bin/learn/lib/editor/L35.2c b/usr.bin/learn/lib/editor/L35.2c deleted file mode 100644 index cbf4e9d320a..00000000000 --- a/usr.bin/learn/lib/editor/L35.2c +++ /dev/null @@ -1,22 +0,0 @@ -#print -You can use '*' to look for a string of characters -from one of the character classes. Suppose, for example, -we wanted a long string of either 'a' or 'b', followed -by 'x'. Then we could write - - s/[ab]*x/.../ - -In this directory is a file named "table". -It has only one line. On that line, replace all the digits -followed by a comma with the letters "too big". For example, -"123,000" should become "too big,000". -Then rewrite the file and type "readY". -#create Ref -Heathrow too big,159 -#create table -Heathrow 17073,159 -#user -#cmp table Ref -#log -#next -35.2d 5 diff --git a/usr.bin/learn/lib/editor/L35.2d b/usr.bin/learn/lib/editor/L35.2d deleted file mode 100644 index d92b66952c1..00000000000 --- a/usr.bin/learn/lib/editor/L35.2d +++ /dev/null @@ -1,25 +0,0 @@ -#print -A useful operation is to replace a string of several blanks -by exactly one blank. Note that you can't just write - -s/ */ / - -because the " *" willl match any number of blanks -including zero. Thus it will always match at the beginning -of the line, even if there is no blank there. -The normal sequence is - -s/ */ / -which will only substitute for a string -that has at least one blank in it. -Try that command on the line in the file "line". -Then rewrite the file "line" and type "ready". -#create Ref -here is a long space. -#create line -here is a long space. -#user -#cmp line Ref -#log -#next -35.2e 5 diff --git a/usr.bin/learn/lib/editor/L35.2e b/usr.bin/learn/lib/editor/L35.2e deleted file mode 100644 index cd3a6a0f776..00000000000 --- a/usr.bin/learn/lib/editor/L35.2e +++ /dev/null @@ -1,33 +0,0 @@ -#print -A very powerful construction is ".*", -which matches any character (remember '.') -repeated any number of times. For example - -s/a.*b/.../ - -replaces anything of the forms - -axyzb, aaaaaab, a1234b, abbbb - -since it requires just an 'a' and a 'b' -at the ends of the string, with -anything at all in between. -Or, to throw away everything -on a line after the word "stop", you could try - -s/stop.*/stop/ - -In this directory is a file "sentence". -Delete everything after -the word "last" on the second line of the file. -#create Ref -This file has a sentence in which -this is the last -#create sentence -This file has a sentence in which -this is the last word which should be left. -#user -#cmp sentence Ref -#next -36.1a 10 -36.2a 5 diff --git a/usr.bin/learn/lib/editor/L36.1a b/usr.bin/learn/lib/editor/L36.1a deleted file mode 100644 index d0196c6b6c2..00000000000 --- a/usr.bin/learn/lib/editor/L36.1a +++ /dev/null @@ -1,33 +0,0 @@ -#print -So far all the special characters in the substitute command -have been used in the left-hand expression, the one that -is looked for in the line as it exists before the change. -None of these characters are meaningful in the right-hand -expression; for example, - s/ab/a./ -turn "ab" into "a." just as if "." were an ordinary letter. -But there is one character that is special on the right -side of a substitution, which is '&'. The ampersand -is replaced by whatever text is being replaced. In - s/the/&m/ -the string "the" is turned into "them" because the '&' is -replaced by "the". -In this directory there is a file 'text'; on the third line, -change the word 'dog' into 'dogs'; then rewrite the file -and say "ready". -#create Ref -cat -mouse -dogs -rat -#create text -cat -mouse -dog -rat -#user -#cmp text Ref -#log -#next -37.1a 10 -37.2a 6 diff --git a/usr.bin/learn/lib/editor/L36.2a b/usr.bin/learn/lib/editor/L36.2a deleted file mode 100644 index 83801f0c753..00000000000 --- a/usr.bin/learn/lib/editor/L36.2a +++ /dev/null @@ -1,21 +0,0 @@ -#print -So far all the special characters in the substitute -command are used to select the string to be replaced. -There is one character used in the new string to be inserted. -It is '&' which when used on the right hand side of a substitution, -refers to the expression given on the left hand side. -For example, the command - -s/the/&m/ - -changes "the" into "them". Try that on file "text"; -then rewrite the file and type "ready". -#create Ref -we went to see them yesterday. -#create text -we went to see the yesterday. -#user -#cmp text Ref -#log -#next -36.2b 5 diff --git a/usr.bin/learn/lib/editor/L36.2b b/usr.bin/learn/lib/editor/L36.2b deleted file mode 100644 index a9e29309c28..00000000000 --- a/usr.bin/learn/lib/editor/L36.2b +++ /dev/null @@ -1,18 +0,0 @@ -#print -Now, in file 'pets', change the word 'dog' on the third line -into 'dogs'. Then rewrite the file and type "ready". -#create Ref -cats -hamsters -dogs -gerbils -#create pets -cats -hamsters -dog -gerbils -#user -#cmp pets Ref -#log -#next -36.2c 5 diff --git a/usr.bin/learn/lib/editor/L36.2c b/usr.bin/learn/lib/editor/L36.2c deleted file mode 100644 index ac057700f58..00000000000 --- a/usr.bin/learn/lib/editor/L36.2c +++ /dev/null @@ -1,47 +0,0 @@ -#print -On the right side of a substitute, none of the other -special characters mean anything unusual. Thus, if you wanted to -replace the letter 'a' by an asterisk, for example, the obvious -com and would work: - -s/a/*/p - -Try, in the file "data", replacing the comma on the last line -with a period. Then rewrite the file and type "ready". -#create Ref - Square Roots -1.00 1.00 -2.00 1.42 -3.00 1.73 -4.00 2.00 -You really shouldn't be -printing all of this file - -did you forget that '$' is -the address of the last -line of a file? -Use that instead of printing everything. -5.00 2.23 -6.00 2.45 -7.00 2.65 -8.00 2.83 -#create data - Square Roots -1.00 1.00 -2.00 1.42 -3.00 1.73 -4.00 2.00 -You really shouldn't be -printing all of this file - -did you forget that '$' is -the address of the last -line of a file? -Use that instead of printing everything. -5.00 2.23 -6.00 2.45 -7.00 2.65 -8.00 2,83 -#user -#cmp data Ref -#log -#next -36.2d 5 diff --git a/usr.bin/learn/lib/editor/L36.2d b/usr.bin/learn/lib/editor/L36.2d deleted file mode 100644 index c236185a318..00000000000 --- a/usr.bin/learn/lib/editor/L36.2d +++ /dev/null @@ -1,21 +0,0 @@ -#print -On line 4 of the file "attribute" is either the word -"color" or the word "Color". With one command -add an 's' to the end of the word. Check that you did it right; -then rewrite the file and type "ready". -#create Ref -size weight mass -density shade hue -quality age price -lifetime Colors durability -#create attribute -size weight mass -density shade hue -quality age price -lifetime Color durability -#user -#cmp attribute Ref -#log -#next -37.1a 10 -37.2a 6 diff --git a/usr.bin/learn/lib/editor/L37.1a b/usr.bin/learn/lib/editor/L37.1a deleted file mode 100644 index da094dbde2f..00000000000 --- a/usr.bin/learn/lib/editor/L37.1a +++ /dev/null @@ -1,27 +0,0 @@ -#print -You can use a range of line numbers with the -substitute command to change more than one line at once. -For example, - 1,5s/dog/&s/ -will change "dog" on each of the first five lines of the -file into "dogs". Edit file "text" and change the word -"cat" on every line into "mouse". -Then rewrite the file and type "ready". -#create Ref -domestic mouse -alley mouse -persian mouse -angora mouse -wildmouse -#create text -domestic cat -alley cat -persian cat -angora cat -wildcat -#user -#cmp text Ref -#log -#next -38.1a 10 -38.2a 6 diff --git a/usr.bin/learn/lib/editor/L37.2a b/usr.bin/learn/lib/editor/L37.2a deleted file mode 100644 index 5fac5825d61..00000000000 --- a/usr.bin/learn/lib/editor/L37.2a +++ /dev/null @@ -1,30 +0,0 @@ -#print -A range of line numbers can be used with the substitute -command as with the print command. For example, - -$-4,$s/cat/&s/p - -will change "cat" into "cats" on the last five lines of -a file. In this directory there is a file "cliche" -containing a number of instances of the word "dog"; change -the instances of "dog" in the first five lines to "dogs". -Then rewrite the file and type "ready". -#create Ref -dogs tired -sick as a dogs -dogs eared -wouldn't send a dogs out on a night like this -every dogs has his day -dog gone -#create cliche -dog tired -sick as a dog -dog eared -wouldn't send a dog out on a night like this -every dog has his day -dog gone -#user -#cmp cliche Ref -#log -#next -37.2b 5 diff --git a/usr.bin/learn/lib/editor/L37.2b b/usr.bin/learn/lib/editor/L37.2b deleted file mode 100644 index 5138f4042f0..00000000000 --- a/usr.bin/learn/lib/editor/L37.2b +++ /dev/null @@ -1,20 +0,0 @@ -#print -Now edit file "text" and change the "cat" on every line -into "mouse". Then rewrite the file and type "ready". -#create Ref -domestic mouse -alley mouse -persian mouse -angora mouse -wildmouse -#create text -domestic cat -alley cat -persian cat -angora cat -wildcat -#user -#cmp text Ref -#log -#next -37.2c 5 diff --git a/usr.bin/learn/lib/editor/L37.2c b/usr.bin/learn/lib/editor/L37.2c deleted file mode 100644 index 7ac6e2f7fb7..00000000000 --- a/usr.bin/learn/lib/editor/L37.2c +++ /dev/null @@ -1,27 +0,0 @@ -#print -How would you find a string of digits? Remember -[1234567890][1234567890]* -as an expression? In this directory is a file -"table" which contains some numbers. On every -line of the file, follow all numbers by the -character '%'. It should only take one 's' command. -Then rewrite the file and type "ready". -#create Ref - Budget Outlays -Salaries 32% -Equipment 40% -Rent 13% (incl. utilities) -Interest 9% -Misc. 6% -#create table - Budget Outlays -Salaries 32 -Equipment 40 -Rent 13 (incl. utilities) -Interest 9 -Misc. 6 -#user -#cmp table Ref -#log -#next -37.2d 5 diff --git a/usr.bin/learn/lib/editor/L37.2d b/usr.bin/learn/lib/editor/L37.2d deleted file mode 100644 index 4d882188a9b..00000000000 --- a/usr.bin/learn/lib/editor/L37.2d +++ /dev/null @@ -1,22 +0,0 @@ -#print -There is another file named "table" in this directory. -Find all numbers and surround them with "*" characters (that -is, "345" becomes "*345*". Then rewrite the file -and type "ready". -#create Ref - Income -Wages *73* -Interest *20* -Gambling *5* -Other *2* -#create table - Income -Wages 73 -Interest 20 -Gambling 5 -Other 2 -#user -#cmp table Ref -#log -#next -37.2e 5 diff --git a/usr.bin/learn/lib/editor/L37.2e b/usr.bin/learn/lib/editor/L37.2e deleted file mode 100644 index df98a4693e1..00000000000 --- a/usr.bin/learn/lib/editor/L37.2e +++ /dev/null @@ -1,39 +0,0 @@ -#print -Here is something a bit trickier. We want to add -an extra space after each word "lengthen". However, -some of the instances of "lengthen" are followed -by commas or right parentheses and we want the sapace -after the comma or right parenthesis in that case. That -is, the desired transformations are: - now new -lengthen xx lengthen xx -lengthen, xx lengthen, xx -lengthen) xx lengthen) xx -lengthen), xx lengthen), xx -It should only take one substitute command to do this. -Remember that "*" matches zero or more instances of -whatever precedes it. -Try those changes on the first six lines of the file -"text" in this directory. Then rewrite the file and -type "ready". -#create Ref -To lengthen this is easy, -whereas to lengthen, rather -than to shorten, on the previous line -is hard. (To lengthen) is an -infinitive. I said to him, (please lengthen), and -he did so. -Why not lengthen this word? Notice it is on line 7. -#create text -To lengthen this is easy, -whereas to lengthen, rather -than to shorten, on the previous line -is hard. (To lengthen) is an -infinitive. I said to him, (please lengthen), and -he did so. -Why not lengthen this word? Notice it is on line 7. -#user -#cmp text Ref -#log -#next -37.2f 5 diff --git a/usr.bin/learn/lib/editor/L37.2f b/usr.bin/learn/lib/editor/L37.2f deleted file mode 100644 index 96c33afa6e4..00000000000 --- a/usr.bin/learn/lib/editor/L37.2f +++ /dev/null @@ -1,23 +0,0 @@ -#print -The file "paragraph" in this directory contains -a number of commas followed by blanks. Please see -to it that all commas are followed by exactly one blank. -Then rewrite the file and type "ready". -#create Ref -This text, although somewhat -strained, is not really -unintelligible. We have, you see -to get enough commas, like this -into it to give you some real practice. -#create paragraph -This text, although somewhat -strained, is not really -unintelligible. We have, you see -to get enough commas,like this -into it to give you some real practice. -#user -#cmp paragraph Ref -#log -#next -38.1a 10 -38.2a 6 diff --git a/usr.bin/learn/lib/editor/L38.1a b/usr.bin/learn/lib/editor/L38.1a deleted file mode 100644 index ffa16c53b03..00000000000 --- a/usr.bin/learn/lib/editor/L38.1a +++ /dev/null @@ -1,29 +0,0 @@ -#print -Sometimes it is desirable to specify that -the characters to be changed are at the beginning -of the line. This uses the '^' character. For example, - s/^ab/xy/p -will change "ab" to "xy" ONLY if "ab" begins the line. -Remember that - s/ab/xy/p -would just change the first "ab" anywhere in the line. -In this directory there is a file "text"; whenever the -letters "cat" begin a line, change them to "mouse; but leave -other instances of "cat" unaltered. Do this on each line (it only -takes one command, as you know). Then rewrite the file and -type "ready". -#create Ref -mouse's paw -alley cat -mouse has nine lives -let the cat out of the bag -#create text -cat's paw -alley cat -cat has nine lives -let the cat out of the bag -#user -#cmp Ref text -#log -#next -39.1a 10 diff --git a/usr.bin/learn/lib/editor/L38.2a b/usr.bin/learn/lib/editor/L38.2a deleted file mode 100644 index 2f9942a4148..00000000000 --- a/usr.bin/learn/lib/editor/L38.2a +++ /dev/null @@ -1,26 +0,0 @@ -#print -Sometimes you want to recognize a string of characters -only if they appear at the beginning of the line. -The character '^' is used for this purpose. The -command - s/^ab/xy/ -will change "ab" to "xy" only if "ab" begins the line. -Try the following and watch what it does. - -ed file -1,2p -1,2s/^ab/xy/ -w -q -ready -#create Ref -xycd - abcd -#create file -abcd - abcd -#user -#cmp file Ref -#log -#next -38.2b 5 diff --git a/usr.bin/learn/lib/editor/L38.2b b/usr.bin/learn/lib/editor/L38.2b deleted file mode 100644 index 987c21bea64..00000000000 --- a/usr.bin/learn/lib/editor/L38.2b +++ /dev/null @@ -1,20 +0,0 @@ -#print -In this directory there is a file "text"; whenever the -letters "cat" begin a line, change them to "mouse"; but -leave other instances of "cat" unaltered. Do this on each line. -Then rewrite the file and type "ready". -#create Ref -mouse's paw -alley cat -mouse has nine lives -let the cat out of the bag -#create text -cat's paw -alley cat -cat has nine lives -let the cat out of the bag -#user -#cmp text Ref -#log -#next -39.1a 10 diff --git a/usr.bin/learn/lib/editor/L39.1a b/usr.bin/learn/lib/editor/L39.1a deleted file mode 100644 index 722f8e7f52a..00000000000 --- a/usr.bin/learn/lib/editor/L39.1a +++ /dev/null @@ -1,28 +0,0 @@ -#print -Using the "^" character, you can easily put things -at the beginnings of lines. For example - s/^/***/ -puts "***" at the beginning of the line. Now edit -the file "text" and put the symbol '=' at the beginning -of lines 3 through 5. Then rewrite the file and type "ready". -#create Ref -beef -pork -=chicken -=duck -=turkey -lamb -fish -#create text -beef -pork -chicken -duck -turkey -lamb -fish -#user -#cmp text Ref -#log -#next -40.1a 10 diff --git a/usr.bin/learn/lib/editor/L4.1a b/usr.bin/learn/lib/editor/L4.1a deleted file mode 100644 index 5ee279f3910..00000000000 --- a/usr.bin/learn/lib/editor/L4.1a +++ /dev/null @@ -1,23 +0,0 @@ -#print -You must recognize that the commands typed at the -editor are distinct from the commands typed at the -normal UNIX command interpreter. In particular, -neither program knows the commands recognized by the -other one. So you must always remember when you -are talking to the normal command interpreter (the -one that says $ to you) and when you are talking -to the editor. The commands 'w' and 'q' are recognized -by the editor. The commands 'ls', 'mv' and so forth -are not. - -Can you expect the editor to recognize the command - cat george -Type yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -4.1b 5 -5.1a 10 diff --git a/usr.bin/learn/lib/editor/L4.1b b/usr.bin/learn/lib/editor/L4.1b deleted file mode 100644 index a836e2d801a..00000000000 --- a/usr.bin/learn/lib/editor/L4.1b +++ /dev/null @@ -1,12 +0,0 @@ -#print -Can you expect the normal command interpreter (called -the 'shell') to recognize - w -Type yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -5.1a 10 diff --git a/usr.bin/learn/lib/editor/L4.2a b/usr.bin/learn/lib/editor/L4.2a deleted file mode 100644 index 60598abac58..00000000000 --- a/usr.bin/learn/lib/editor/L4.2a +++ /dev/null @@ -1,17 +0,0 @@ -#print -The editor and the 'shell' (the normal command -interpreter) accept different commands. The -shell (which types '$' at you) understands -"ls", "mv", "cp", "date" and so forth; the -editor understands such commands as 'w' or 'q'. - -Who knows about "diff"? -Type "answer shell" or "answer editor". -#copyin -#user -#uncopyin -#match shell -#log -#next -4.2b 5 -4.1b 10 diff --git a/usr.bin/learn/lib/editor/L4.2b b/usr.bin/learn/lib/editor/L4.2b deleted file mode 100644 index 8b1e8d75268..00000000000 --- a/usr.bin/learn/lib/editor/L4.2b +++ /dev/null @@ -1,11 +0,0 @@ -#print -Who will recognize 'w'? -Type "answer shell" or "answer editor". -#copyin -#user -#uncopyin -#match editor -#log -#next -4.1b 5 -5.1a 10 diff --git a/usr.bin/learn/lib/editor/L40.1a b/usr.bin/learn/lib/editor/L40.1a deleted file mode 100644 index 0ed8b0e3ccb..00000000000 --- a/usr.bin/learn/lib/editor/L40.1a +++ /dev/null @@ -1,29 +0,0 @@ -#print -There is also a special character which indicates -the end of the line. It is '$'. So that - s/ab$/xy/ -changes 'ab' to 'xy' only if 'ab' ended the line. -In the file 'text' there are some lines which end -in 'cup'. Change them to end in 'saucer'. Again, -it only takes one command. -Then rewrite the file and type 'ready'. -#create Ref -3 teaspoons = 1 tablespoon -16 tablespoons = 1 saucer -48 teaspoons = 1 saucer -2 cups = 1 pint -2 pints = 1 quart -1/2 pt = 1 saucer -#create text -3 teaspoons = 1 tablespoon -16 tablespoons = 1 saucer -48 teaspoons = 1 saucer -2 cups = 1 pint -2 pints = 1 quart -1/2 pt = 1 saucer -#user -#cmp text Ref -#log -#next -40.1b 5 -40.2b 10 diff --git a/usr.bin/learn/lib/editor/L40.1b b/usr.bin/learn/lib/editor/L40.1b deleted file mode 100644 index 77cd8c901ca..00000000000 --- a/usr.bin/learn/lib/editor/L40.1b +++ /dev/null @@ -1,29 +0,0 @@ -#print -You can also use '$' when you -just want to add something to the end of a line. -For example, - s/$/./ -puts a period at the end of a line, without destroying -anything in the line. In file 'decl' there should be a -comma at the end of the third line. Edit this file, -put in the comma, and rewrite the file. Then type "ready". -#create Ref -When in the course of human events, it becomes -necessary for one people to dissolve the political -bands which have connected them with another, -and to assume among the powers of the earth the separate -and equal station to which the laws -of Nature and of Nature's God entitle them ... -#create decl -When in the course of human events, it becomes -necessary for one people to dissolve the political -bands which have connected them with another -and to assume among the powers of the earth the separate -and equal station to which the laws -of Nature and of Nature's God entitle them ... -#user -#cmp decl Ref -#log -#next -41.1a 10 -40.2b 9 diff --git a/usr.bin/learn/lib/editor/L40.2b b/usr.bin/learn/lib/editor/L40.2b deleted file mode 100644 index b0e36e6d284..00000000000 --- a/usr.bin/learn/lib/editor/L40.2b +++ /dev/null @@ -1,27 +0,0 @@ -#print -In the file "section" change all lines ending in the characters - ", -to end in - ," -so that, for example, the line - He said "I'll come", -becomes - He said "I'll come," -and then rewrite the file and type "ready". -#create Ref -This passage contains a few -quoted "strings," -of which some are "in the middle", and some -"are at the beginning", and some "are at the end," -but all end with commas. -#create section -This passage contains a few -quoted "strings", -of which some are "in the middle", and some -"are at the beginning", and some "are at the end", -but all end with commas. -#user -#cmp section Ref -#log -#next -40.2c 5 diff --git a/usr.bin/learn/lib/editor/L40.2c b/usr.bin/learn/lib/editor/L40.2c deleted file mode 100644 index 60bd44b1396..00000000000 --- a/usr.bin/learn/lib/editor/L40.2c +++ /dev/null @@ -1,22 +0,0 @@ -#print -In the file "mess" delete all blanks at the ends -of lines. Be prepared to delete several blanks -if need be (remember the '*' character). -Then rewrite the file and type "ready". -#create Ref -It is possible to use -a small counter to keep -approximate counts -of large numbers. The resulting -expected error can be controlled. -#create mess -It is possible to use -a small counter to keep -approximate counts -of large numbers. The resulting -expected error can be controlled. -#user -#cmp mess Ref -#log -#next -40.2d 5 diff --git a/usr.bin/learn/lib/editor/L40.2d b/usr.bin/learn/lib/editor/L40.2d deleted file mode 100644 index 8a738e49538..00000000000 --- a/usr.bin/learn/lib/editor/L40.2d +++ /dev/null @@ -1,23 +0,0 @@ -#print -In file "poem" add the character "." (period) -at the end of lines 3 through the end of the file. -Then rewrite the file and type "ready". -#create Ref -When I was a lad I served a term - As office boy in an attorney's firm -I washed the windows and I swept the floor. - And I polished up the handles on the big brass door. -I polished up those handles so carefully. - That now I am the ruler of the Queen's Navy. -#create poem -When I was a lad I served a term - As office boy in an attorney's firm -I washed the windows and I swept the floor - And I polished up the handles on the big brass door -I polished up those handles so carefully - That now I am the ruler of the Queen's Navy -#user -#cmp poem Ref -#log -#next -41.1a 10 diff --git a/usr.bin/learn/lib/editor/L41.1a b/usr.bin/learn/lib/editor/L41.1a deleted file mode 100644 index f8ab0ab3b3f..00000000000 --- a/usr.bin/learn/lib/editor/L41.1a +++ /dev/null @@ -1,44 +0,0 @@ -#print -One thing you must be careful of is that the substitute -command does not know about word boundaries. It will -change the first occurrence of a letter string it matches -without regard to blanks or punctuation around it. Thus, -if the current line is - i would rather be the king -and you type - s/the/a/p -you get - i would raar be the king -instead of - i would rather be a king -Right? You should always print lines after changing them -to avoid missing such errors. You can defend against them -by increasing the amount of context you specify; in this -case, for example, you could say - s/the /a /p -and get - i would rather be a king -Often the "$" operator is useful here, if you want to -change the last thing on the line. In the file 'text', -the third line reads - never, never, never, never, never -Edit this file to make the third line read - never, never, never, never, or hardly ever -Rewrite the file and type "ready". -#create Ref -why should a dog, a horse, a rat, have life, -and thou no breath at all? thou'lt come no more, -never, never, never, never, or hardly ever -pray you, undo this button. thank you, sir. -#create text -why should a dog, a horse, a rat, have life, -and thou no breath at all? thou'lt come no more, -never, never, never, never, never -pray you, undo this button. thank you, sir. -#user -#cmp text Ref -#log -#next -42.1a 10 -41.1b 5 -42.2a 6 diff --git a/usr.bin/learn/lib/editor/L41.1b b/usr.bin/learn/lib/editor/L41.1b deleted file mode 100644 index 9d02aec5165..00000000000 --- a/usr.bin/learn/lib/editor/L41.1b +++ /dev/null @@ -1,19 +0,0 @@ -#print -There is a mistyped word in the third line of the file "problem". -Fix it, rewrite the file, and type "ready". -#create Ref -The computer costs too much. -No one knows how to use it. -The switchboard in the main office is broken. -It takes too long to get anything done. -#create problem -The computer costs too much. -No one knows how to use it. -The switchboard in thb main office is broken. -It takes too long to get anything done. -#user -#cmp problem Ref -#log -#next -42.1a 10 -42.2a 5 diff --git a/usr.bin/learn/lib/editor/L42.1a b/usr.bin/learn/lib/editor/L42.1a deleted file mode 100644 index 4d04eb1c61e..00000000000 --- a/usr.bin/learn/lib/editor/L42.1a +++ /dev/null @@ -1,28 +0,0 @@ -#print -Normally the 's' command only changes -the first instance on a line of the expression -it is looking for. Sometimes you want to change -more than one instance. If you put a 'g' after the -command, as in - s/cat/dog/g -all instances of 'cat' will be changed to 'dog'. To -print the result you must say - s/cat/dog/gp -('pg' at the end doesn't work, sorry). -Edit file 'stuff' in this directory to change every -instance of 'green' to 'red' on every line. -Then rewrite the file and type "ready". -#create Ref -red light, village red -red book, red paper, red pencil -red car, red sign, redhorn -#create stuff -green light, village green -green book, green paper, green pencil -green car, green sign, greenhorn -#user -#cmp stuff Ref -#log -#next -43.1a 10 -43.2a 5 diff --git a/usr.bin/learn/lib/editor/L42.2a b/usr.bin/learn/lib/editor/L42.2a deleted file mode 100644 index ba649d4a39e..00000000000 --- a/usr.bin/learn/lib/editor/L42.2a +++ /dev/null @@ -1,24 +0,0 @@ -#print -Normally the 's' command only changes the first instance -on a line of the expression it is recognizing. Sometimes you want -to change everything. For example, try the following sequence, -and note the difference between the changes on the two lines. - -ed test -1,2p -1s/cat/cats/p -2s/cat/cats/gp -w -q -ready -#create Ref -the cats in the catalog is a persian cat -the cats in the catsalog is a persian cats -#create test -the cat in the catalog is a persian cat -the cat in the catalog is a persian cat -#user -#cmp test Ref -#log -#next -42.2b 5 diff --git a/usr.bin/learn/lib/editor/L42.2b b/usr.bin/learn/lib/editor/L42.2b deleted file mode 100644 index dc2dd431f43..00000000000 --- a/usr.bin/learn/lib/editor/L42.2b +++ /dev/null @@ -1,18 +0,0 @@ -#print -Now pick up the file 'stuff', change all instances of "green" -everywhere to "red", and then rewrite the file and type "ready". -#create Ref -red light, village red -red book, red paper, red pencil -red car, red sign, redhorn -red with envy -#create stuff -green light, village green -green book, green paper, green pencil -green car, green sign, greenhorn -green with envy -#user -#cmp stuff Ref -#log -#next -42.2c 5 diff --git a/usr.bin/learn/lib/editor/L42.2c b/usr.bin/learn/lib/editor/L42.2c deleted file mode 100644 index 5f1557add41..00000000000 --- a/usr.bin/learn/lib/editor/L42.2c +++ /dev/null @@ -1,31 +0,0 @@ -#print -Remember the procedures with '*' for changing one or more -of something into one something. Pick up the file -"sloppy" and on every line, whereever there are several -blanks in a row change them to one blank. This can be done -with one command; it is a very common task. Then rewrite the file -and type "ready". -#create Ref -It seems that medieval art - Alone retains its zest -To charm and please its devotees - We've done our level best -We're not quite sure that all we do - Has the Early English ring -But as far as we can tell - It's something like this sort of thing. -#create sloppy -It seems that medieval art - Alone retains its zest -To charm and please its devotees - We've done our level best -We're not quite sure that all we do - Has the Early English ring -But as far as we can tell - It's something like this sort of thing. -#user -#cmp sloppy Ref -#log -#next -43.1a 10 -43.2a 5 diff --git a/usr.bin/learn/lib/editor/L43.1a b/usr.bin/learn/lib/editor/L43.1a deleted file mode 100644 index e73468ed538..00000000000 --- a/usr.bin/learn/lib/editor/L43.1a +++ /dev/null @@ -1,29 +0,0 @@ -#print -Note that there is quite a list of special characters -recognized by the editor: - . [ * ^ $ & / -What do you do when you want to specifically use -one of these characters as itself, rather than -for its funny meaning? You must precede it by a backslash, -as in - s/\./,/p -which will change the line - x, y. and z -into - x, y, and z -easily. The same works for all the other special -characters. What command would change - * -into - c -Type "answer COMMAND" where COMMAND is of the form - s/.././p -#copyin -#user -#uncopyin -#match s/\*/c/p -#match s/\*/c/ -You forgot the "p" on the end. -#log -#next -44.1a 10 diff --git a/usr.bin/learn/lib/editor/L43.2a b/usr.bin/learn/lib/editor/L43.2a deleted file mode 100644 index f8af90eadd2..00000000000 --- a/usr.bin/learn/lib/editor/L43.2a +++ /dev/null @@ -1,32 +0,0 @@ -#print -Note that there is quite a list of characters that -are special to the editor: - . [ * ^ $ & / -What do you do when you want to use one of these -characters as itself, rather than for its special meaning? -You must precede it by a backlash. For example, how -would you turn - ". -into - ." -Try the following sequence: - -ed test -1,3p -1,3s/"\./."/p -w -q -ready -#create Ref -This is a "quoted word." -Here is "another." -Be "careful." Especially with dots. -#create test -This is a "quoted word". -Here is "another". -Be "careful". Especially with dots. -#user -#cmp test Ref -#log -#next -43.2b 5 diff --git a/usr.bin/learn/lib/editor/L43.2b b/usr.bin/learn/lib/editor/L43.2b deleted file mode 100644 index 68bf60a6b80..00000000000 --- a/usr.bin/learn/lib/editor/L43.2b +++ /dev/null @@ -1,15 +0,0 @@ -#print -Pick up the file "line" and change - x, y. and z -into - x, y, and z -Then rewrite the file and type "ready". -#create Ref - x, y, and z -#create line - x, y. and z -#user -#cmp line Ref -#log -#next -43.2c 5 diff --git a/usr.bin/learn/lib/editor/L43.2c b/usr.bin/learn/lib/editor/L43.2c deleted file mode 100644 index 30b606ecd6a..00000000000 --- a/usr.bin/learn/lib/editor/L43.2c +++ /dev/null @@ -1,23 +0,0 @@ -#print -This is trickier. Change all sequences of several -asterisks into one asterisk. E.g. - *** xxx **** -becomes - * xxx * -The file is named "stars"; edit it -and then rewrite it. Then type "ready". -#create Ref - List of phone numbers - * 6377 * - * 4582 * - * 3968 * -#create stars - List of phone numbers - ** 6377 *** - **** 4582 **** - * 3968 *** -#user -#cmp stars Ref -#log -#next -43.2d 5 diff --git a/usr.bin/learn/lib/editor/L43.2d b/usr.bin/learn/lib/editor/L43.2d deleted file mode 100644 index ab4195b26cd..00000000000 --- a/usr.bin/learn/lib/editor/L43.2d +++ /dev/null @@ -1,19 +0,0 @@ -#print -This is trickier. File "name" contains - A T and T Co. -Change it to read - A T & T Co. -Then rewrite it and type "ready". -#create Ref - A T & T Co. -#create name - A T and T Co. -#user -#cmp name Ref -#succeed -I hope you used - s/and/\&/p -and did not retype the line. -#log -#next -44.1a 5 diff --git a/usr.bin/learn/lib/editor/L44.1a b/usr.bin/learn/lib/editor/L44.1a deleted file mode 100644 index 7ae6dd6a077..00000000000 --- a/usr.bin/learn/lib/editor/L44.1a +++ /dev/null @@ -1,43 +0,0 @@ -#print -You have now learned quite a bit about substitute commands. -Here is a larger task to perform. There is a file 'song' in -this directory. Edit it; print it out, and notice that -there are six mistyped words in it. Fix all of them -and rewrite the file. Then type "ready". -#create Ref -Oh, say can you see - by the dawn's early light -What so proudly we hailed - at the twilight's last gleaming -Whose broad stripes and bright stars - through the perilous night -O'er the ramparts we watched - were so gallantly streaming -And the rocket's red glare, - the bombs bursting in air -Gave proof through the night - that our flag was still there -Oh, say does that star spangled banner yet wave - o'er the land of the free -And the home of the brave? -#create song -Oh, say can yuo see - by the dawn's early light -What so proudly we hailed - at the twilight's last glieaming -Whose broad stxripes and bright stxars - through the perilous night -O'er the ramparts we watched - were so gallantly streammming -And the rocket's red glare, - the bombs bursting in air -Gave proof through thre night - that our flag was still there -Oh, say does that star spangled banner yet wave - o'er the land of the free -And the home of the brave? -#user -#cmp song Ref -#log -#next -44.1b 10 diff --git a/usr.bin/learn/lib/editor/L44.1b b/usr.bin/learn/lib/editor/L44.1b deleted file mode 100644 index ffe35d4d382..00000000000 --- a/usr.bin/learn/lib/editor/L44.1b +++ /dev/null @@ -1,35 +0,0 @@ -#print -There is a file named "paragraph" in this directory. -It contains three spelling errors, one line is duplicated, -and the last line is missing (the paragraph should end -"has been carefully coded and is now well under control."). -Fix it up and rewrite it. Then type "ready". -#create Ref -Held at arm's length, this program looks pretty impressive. -There is a large assortment of data declarations, followed -by a computation that is evidently complex enough -to warrant a sub-procedure. Declarations are neatly -aligned, and the executable statements are staggered so -as to indicate several levels of control nesting. -There are text strings to suggest the intent of the program, -and mnemonic identifiers to give hints about how the results -are obtained. The general impression conveyed is that -this is a moderately complicated problem that -has been carefully coded and is now well under control. -#create paragraph -Held at arm's length, this program looks pretty impressive. -There is a large assortment of dta declarations, followed -by a computation that is evidently complex enough -to warrant a sub-procedure. Declarations are neatly -aligned, and the executable statements are stagggered so -as to indicate several levels of control nesting. -as to indicate several levels of control nesting. -There are text strings to suggest the intent of the program, -and mnemonic identifiers to give hints about how the results -are obtained. The genreal impression conveyed is that -this is a moderately complicated problem that -#user -#cmp Ref paragraph -#log -#next -44.1c 10 diff --git a/usr.bin/learn/lib/editor/L44.1c b/usr.bin/learn/lib/editor/L44.1c deleted file mode 100644 index d3fee4d2ebb..00000000000 --- a/usr.bin/learn/lib/editor/L44.1c +++ /dev/null @@ -1,49 +0,0 @@ -#print -There is a file "list" in this directory which contains -some names. Here are the addresses: add them on -lines after the name (i.e. the file should look like: - - Joe Blow - 45 Western Ave. - Elmira, NY 10445 - - Sam Jones - 97 Fifth St. - Oshkosh, WI 52302 - ... -when you are done). - - Name address is -Ford 1600 Pennsylvania Ave., Washington, DC 20515 -Fenwick 1 Morris St., Morristown, NJ 07960 -Rinaldo 308 Main St., Orange, NJ 07050 -Rodino 907 Broad St., Newark NJ 07102 -#create Ref -The Hon. Gerald Ford -1600 Pennsylvania Ave. -Washington, DC 20515 - -The Hon. Millicent Fenwick -1 Morris St. -Morristown, NJ 07960 - -The Hon. Matthew Rinaldo -308 Main St. -Orange, NJ 07050 - -The Hon. Peter Rodino -907 Broad St. -Newark, NJ 07102 -#create list -The Hon. Gerald Ford - -The Hon. Millicent Fenwick - -The Hon. Matthew Rinaldo - -The Hon. Peter Rodino -#user -#cmp Ref list -#log -#next -44.1d 10 diff --git a/usr.bin/learn/lib/editor/L44.1d b/usr.bin/learn/lib/editor/L44.1d deleted file mode 100644 index 5ac83dd0d90..00000000000 --- a/usr.bin/learn/lib/editor/L44.1d +++ /dev/null @@ -1,54 +0,0 @@ -#print -In file "locs" is a list of Bell Labs locations. -Bring it up to date by - a) replace "Raritan River" by "Piscataway" - b) delete "Denville". - c) insert "Atlanta". - d) spell "Merrimack Valley" correctly. -#create Ref -Allentown -Atlanta -Centennial Park -Chester -Columbus -Crawford Hill -Denver -Grand Forks -Guilford Center -Holmdel -Indianapolis -Indian Hill -Kwajalein -Madison -Merrimack Valley -Murray Hill -Piscataway -Reading -Warren -Whippany -#create locs -Allentown -Centennial Park -Chester -Columbus -Crawford Hill -Denver -Denville -Grand Forks -Guilford Center -Holmdel -Indianapolis -Indian Hill -Kwajalein -Madison -Merimack Valley -Murray Hill -Raritan River -Reading -Warren -Whippany -#user -#cmp locs Ref -#log -#next -44.1e diff --git a/usr.bin/learn/lib/editor/L44.1e b/usr.bin/learn/lib/editor/L44.1e deleted file mode 100644 index 042df33fcac..00000000000 --- a/usr.bin/learn/lib/editor/L44.1e +++ /dev/null @@ -1,26 +0,0 @@ -#print -As you've probably noticed, the backslash character "\" -is rather special to the editor (and to other programs -as well). So what do you do when you have to somehow -get a backslash into some text, or to edit it in -or out? - -Getting it in in the first place is quite easy: when -you are appending with "a" (or inserting with "i", or -changing with "c", or reading with "r"), there's -nothing special about "\" at all. To verify this, -add the line - -Two backslashes \\ do not equal one forward slash. - -to the file "junk", re-write it, then type "ready". -#create Ref -This is a file with a silly line in it. -Two backslashes \\ do not equal one forward slash. -#create junk -This is a file with a silly line in it. -#user -#cmp Ref junk -#log -#next -44.1f 10 diff --git a/usr.bin/learn/lib/editor/L44.1f b/usr.bin/learn/lib/editor/L44.1f deleted file mode 100644 index b1692874f8a..00000000000 --- a/usr.bin/learn/lib/editor/L44.1f +++ /dev/null @@ -1,32 +0,0 @@ -#print -The next step is to learn how to edit a line -that contains a backslash. On the left side of an "s" -command, you place a "\" before the "\" to turn off -its special meaning, just as for any other special -character like "*" or "[". For example, -if you have the line - c = '\n' -you can change it into - c = 'n' -with the command - s/\\n/n/ -or - s/\\// -(Your choice.) - -Practice by removing all the backslashes from the -file "junk"; when you're done, re-write it and -type "ready". -#create Ref -Now is the time for all good -men to come to the aid of -their party, or something like that. -#create junk -Now is \the \tim\\e for all good -m\\en \to com\\e \to \the aid of -\their par\ty, or som\\e\thing like \tha\t. -#user -#cmp Ref junk -#log -#next -44.1g 10 diff --git a/usr.bin/learn/lib/editor/L44.1g b/usr.bin/learn/lib/editor/L44.1g deleted file mode 100644 index 0ea3d7894c7..00000000000 --- a/usr.bin/learn/lib/editor/L44.1g +++ /dev/null @@ -1,121 +0,0 @@ -#print -Of course, you can also search for lines that -contain backslashes; again, it's simply a matter -of doubling the backslash in the search pattern. -That is, - /\\/ -finds the next line with a backslash. - -Find the second occurrence of "\n\n" in the file -"prog.c", and type "answer N", where N is its -line number. -#create prog.c - -int nsave = 0; - -selunit() -{ - char fnam[20], s[50]; - static char dobuff[50]; - char posslev[20][20]; - int diff[20], i, k, m, n, best, alts, statb[20]; - FILE *f; - char zb[200]; - static char saved[20]; - - while (ask) { - printf("What lesson? "); - fflush(stdout); - gets(dobuff); - if (strcmp(dobuff, "bye") == 0) - wrapup(0); - level = todo = dobuff; - snprintf(s, sizeof s, "../L%s", dobuff); - if (access(s, 04) == 0) - return; - printf("no such lesson\n"); - } - alts = 0; -retry: - f=scrin; - if (f==NULL) { - snprintf(fnam, sizeof fnam, "../L%s", level); - f = fopen(fnam, "r"); - if (f==NULL) { - fprintf(stderr, "No script for lesson %s.\n", level); - wrapup(1); - } - while (fgets(zb, 200, f)) { - trim(zb); - if (strcmp(zb, "#next")==0) - break; - } - } - if (feof(f)) { - printf("Congratulations\n\n.You have finished this sequence.\n"); - fflush(stdout); - todo = 0; - return; - } - for(i=0; fgets(s, 50, f); i++) { - sscanf(s, "%s %d", &posslev[i], &diff[i]); - } - best = -1; - /* cycle through lessons from random start */ - /* first try the current place, failing that back up to - last place there are untried alternatives (but only one backup) */ - n = grand()%i; - for(k=0; k<i; k++) { - m = (n+k)%i; - if (already(posslev[m])) continue; - if (best<0) best=m; - /* real alternatives */ - alts++; - if (abs(diff[m]-speed) < abs(diff[best]-speed)) - best=m; - } - if (best < 0 && nsave) { - nsave--; - strlcpy(level, saved, sizeof level); - goto retry; - } - if (best <0) { - /* lessons exhausted or missing */ - printf("Sorry, there are no alternative lessons at this stage.\n"); - printf("See someone for help.\n\n"); - fflush(stdout); - todo = 0; - return; - } - strlcpy(dobuff, posslev[best], sizeof dobuff); - if (alts>1) { - nsave=1; - strcpy(saved, level, sizeof saved); - } - todo = dobuff; - fclose(f); -} - -abs(x) -{ - return(x>=0? x: -x); -} - -grand() -{ - static int garbage; - int a[2], b; - - time(a); - b = a[1]+10*garbage++; - return(b&077777); -} -#copyin -#user -#uncopyin -#match 73 -#bad 43 -The second______ one. -#log -#next -44.1h 10 diff --git a/usr.bin/learn/lib/editor/L44.1h b/usr.bin/learn/lib/editor/L44.1h deleted file mode 100644 index c8db43ef05f..00000000000 --- a/usr.bin/learn/lib/editor/L44.1h +++ /dev/null @@ -1,29 +0,0 @@ -#print -The next trick is to substitute a "\" into a line. -The same idea holds: simply double the backslash, -but this time on the right side of the "s" command. - -In the file "prog.c", convert every - 'n' -into - "\n" -Re-write the file, and type "ready". -#create Ref - x = "\n"; - y = 'nop'; - z = 'lmn'; - q = "n"; - r = "\n"+1; - s = "\n" - "\n"; -#create prog.c - x = 'n'; - y = 'nop'; - z = 'lmn'; - q = "n"; - r = 'n'+1; - s = 'n' - 'n'; -#user -#cmp Ref prog.c -#log -#next -44.1i 10 diff --git a/usr.bin/learn/lib/editor/L44.1i b/usr.bin/learn/lib/editor/L44.1i deleted file mode 100644 index df4964cfdcc..00000000000 --- a/usr.bin/learn/lib/editor/L44.1i +++ /dev/null @@ -1,19 +0,0 @@ -#print -One last one with "\". Add the following to -the end of the first line in file "temp", -separated by a single blank. - -/* &"\n" isn't &'\n' */ - -You can do it by re-typing the line, but it's -a nice exercise to use "s". -Type "ready" after you have re-written the file. -#create Ref -p = &"\n"; /* &"\n" isn't &'\n' */ -#create temp -p = &"\n"; -#user -#cmp temp Ref -#log -#next -45.1a 10 diff --git a/usr.bin/learn/lib/editor/L45.1a b/usr.bin/learn/lib/editor/L45.1a deleted file mode 100644 index c2174f988b9..00000000000 --- a/usr.bin/learn/lib/editor/L45.1a +++ /dev/null @@ -1,36 +0,0 @@ -#print -There is one last class of substitutions that -you should know about: converting one line -into two or more by substituting a newline -into the middle. Suppose you want to split the -line - Now is the time for all good men -into - Now is the time - for all good men -without re-typing. The substitute command is - s/time /time\ - / -The backslash indicates that a newline is to be -inserted at that point; the rest of the "s" -command is actually typed on a new line. - -Practice by splitting the first line in file -"btl" into - -Bell Laboratories -Murray Hill, NJ 07974 - -using the "s" command as illustrated above. -Be sure to delete the comma and space properly. -Re-write the file, then type "ready". -#create Ref -Bell Laboratories -Murray Hill, NJ 07974 -#create btl -Bell Laboratories, Murray Hill, NJ 07974 -#user -#cmp btl Ref -#log -#next -45.1b diff --git a/usr.bin/learn/lib/editor/L45.1b b/usr.bin/learn/lib/editor/L45.1b deleted file mode 100644 index a02865e73f4..00000000000 --- a/usr.bin/learn/lib/editor/L45.1b +++ /dev/null @@ -1,34 +0,0 @@ -#print -The opposite command to splitting is joining. -But this isn't done with a "s" as you might expect; -it uses an entirely separate command called "j" -(for "join"). To join two or more adjacent (!) -lines, such as lines 3 through 6, simply type - 3,6j -You can add a "p" at the end to see the result. - -If you don't specify any lines, "j" by itself joins -line "." and ".+1". -In no case does "j" add any extra blanks -- you have -to put them in for yourself if you want them. - -The file "split" has six lines. Convert it into -three lines by joining 1 and 2, 3 and 4, and 5 and 6. -Make sure that the words are separated by spaces. -Re-write, then type "ready". -#create Ref -Check your arithmetic: avoid costly mistakes. -Attach W-2 forms: they must be attached to your return. -Sign your return: your spouse must sign too. -#create split -Check your arithmetic: -avoid costly mistakes. -Attach W-2 forms: -they must be attached to your return. -Sign your return: -your spouse must sign too. -#user -#cmp Ref split -#log -#next -50.1a diff --git a/usr.bin/learn/lib/editor/L5.1a b/usr.bin/learn/lib/editor/L5.1a deleted file mode 100644 index 0dc34fddd7e..00000000000 --- a/usr.bin/learn/lib/editor/L5.1a +++ /dev/null @@ -1,29 +0,0 @@ -#print -The most frequently used editor command is - p -which prints out a line. Try that now. -Type the command sequence - -p -w -q - -to print out a line, and then write out the file. -Then type "ready". -#create Ref -This is the line to be printed. Don't forget w, then q. -56 -#create file -This is the line to be printed. Don't forget w, then q. -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -2 .ocopy >X2 -#cmp Ref X2 -#log -#next -6.1a 5 -6.2a 2 diff --git a/usr.bin/learn/lib/editor/L50.1a b/usr.bin/learn/lib/editor/L50.1a deleted file mode 100644 index 81bd91d9d7f..00000000000 --- a/usr.bin/learn/lib/editor/L50.1a +++ /dev/null @@ -1,36 +0,0 @@ -#print -So far all the addresses you have used have been -either line numbers, '$', or '.' (or combinations -thereof). The most useful addresses are none of -those, but are specifications of lines by content. -Anything you can ask the substitute command -to find in a line, you can ask the editor to find -in a file. In particular, - /xx/p -is a valid command with a line address - /xx/ -and the 'p' command operator. The address - /xx/ -means 'the next line containing an "xx"'. -So this command prints out the next line which -has an "xx" on it. Edit the file 'text' and -print the line which has 'cat' on it. Then -leave the editor and type "ready". -#create text -This is a short list of -things you might find -in the Sears, Roebuck -catalog. - tools - furniture - electrical parts - clothes - appliances - garden equipment. -#copyout -#user -#uncopyout -grep catalog\. .ocopy >/dev/null -#log -#next -50.1b 10 diff --git a/usr.bin/learn/lib/editor/L50.1b b/usr.bin/learn/lib/editor/L50.1b deleted file mode 100644 index 0dd3895f809..00000000000 --- a/usr.bin/learn/lib/editor/L50.1b +++ /dev/null @@ -1,31 +0,0 @@ -#print -You can use all the special characters in the -search commands. For example, - /^cat/p -prints the first line that BEGINS with 'cat'. -You can even leave out the 'p': - /^cat/ -does the same thing. - -Now go into file 'text' with the editor and -print the first line that ENDS with 'dog'. -Then leave the editor and type 'ready'. -#create text -This is a file which -contains several occurrences -of the word 'dog' in several -places. It would be a doggone -shame if you didn't find -the right dog -to print out. -#copyout -#user -#uncopyout -grep 'dog$' text >X1 -grep 'dog' .ocopy >X3 -tail -1 X3 >X2 -#cmp X1 X2 -#log -#next -50.1c 10 -50.2c 5 diff --git a/usr.bin/learn/lib/editor/L50.1c b/usr.bin/learn/lib/editor/L50.1c deleted file mode 100644 index 3ed8c33e157..00000000000 --- a/usr.bin/learn/lib/editor/L50.1c +++ /dev/null @@ -1,54 +0,0 @@ -#print -You can use other commands than 'p' with these -context search addresses, of course. For example, - /abc.e/s/ab/xx/p -will - (1) search for the next line containing the - expression "abc.e", which matches any line that - has an 'a', then a 'b', then a 'c', then - anything, then an 'e' (so that it matches - "abcde", "abcxe", "abc9e", but not "abceq"); - (2) on that line, change the first "ab" to an "xx". -Edit file 'county'; find the line with 'pacific' on it -and change it to 'ocean'. Then rewrite the file -and type "ready". -#create Ref -passaic -bergen -sussex -hudson -essex -warren -morris -hunderdon -somerset -union -ocean -monmouth -middlesex -mercer -cumberland -cape may -#create county -passaic -bergen -sussex -hudson -essex -warren -morris -hunderdon -somerset -union -pacific -monmouth -middlesex -mercer -cumberland -cape may -#user -#cmp county Ref -#log -#next -51.1a 10 -50.2e 5 diff --git a/usr.bin/learn/lib/editor/L50.2c b/usr.bin/learn/lib/editor/L50.2c deleted file mode 100644 index 72853d2a1c8..00000000000 --- a/usr.bin/learn/lib/editor/L50.2c +++ /dev/null @@ -1,23 +0,0 @@ -#print -Edit file "junk" and print the first line -that contains either "color" or "Color". -Then leave the editor and type "ready". -#create junk -this file contains -a few random lines -much noise -bright Colors -other stuff -colored paper -and color by Technicolor -#create x2 -bright Colors -#copyout -#user -#uncopyout -grep olor .ocopy >x1 -#cmp x1 x2 -#log -#next -50.2d 5 -50.1c 10 diff --git a/usr.bin/learn/lib/editor/L50.2d b/usr.bin/learn/lib/editor/L50.2d deleted file mode 100644 index 48ad25798de..00000000000 --- a/usr.bin/learn/lib/editor/L50.2d +++ /dev/null @@ -1,33 +0,0 @@ -#print -In file "text" print the first -line which contains any of the -words "them", "these", "their", or "there" -(you need only distinguish "the"; that is, -look for the letters "t", "h", and "e" followed -by something other than a blank). Delete the -line you find ; then rewrite the file -and type "ready". -#create Ref -the leaves do not have enough room to hold all the food -that plants make. much of the food has to be stored in remote parts -of the plant. -we eat the parts of plants where the most food is stored. the -carrot plant stores food in its roots. We eat the roots of carrots. -the celery plant stores food in its leaf stalks, which are the parts -the fruits of these plants to get the stored food in them. - some kinds of plants have ways of protecting their stored food. -#create text -the leaves do not have enough room to hold all the food -that plants make. much of the food has to be stored in remote parts -of the plant. -we eat the parts of plants where the most food is stored. the -carrot plant stores food in its roots. We eat the roots of carrots. -the celery plant stores food in its leaf stalks, which are the parts -we eat. many kinds of plants store food in their fruits. we eat -the fruits of these plants to get the stored food in them. - some kinds of plants have ways of protecting their stored food. -#user -#cmp text Ref -#log -#next -50.1c 10 diff --git a/usr.bin/learn/lib/editor/L50.2e b/usr.bin/learn/lib/editor/L50.2e deleted file mode 100644 index 73408a0246d..00000000000 --- a/usr.bin/learn/lib/editor/L50.2e +++ /dev/null @@ -1,28 +0,0 @@ -#print -Please edit a file named "news" and find the -first word containing the three letters "ufa". -Make the word plural, rewrite the file, and -type "ready". -#create Ref -It was announced today in -Washington that the GNP was -up at an annual rate of 8.2 % -in the third quarter of 1975. -Fishing and agriculture declined -slightly but manufactures increased -substantially. The overall gain -was impressive and confirms economic recovery. -#create news -It was announced today in -Washington that the GNP was -up at an annual rate of 8.2 % -in the third quarter of 1975. -Fishing and agriculture declined -slightly but manufacture increased -substantially. The overall gain -was impressive and confirms economic recovery. -#user -#cmp news Ref -#log -#next -50.2f 10 diff --git a/usr.bin/learn/lib/editor/L50.2f b/usr.bin/learn/lib/editor/L50.2f deleted file mode 100644 index f25f7153474..00000000000 --- a/usr.bin/learn/lib/editor/L50.2f +++ /dev/null @@ -1,343 +0,0 @@ -#print -Look in the file "story". Somewhere is a line -containing the word "season". Find it, and find -what line number it has. Leave the editor -and type "answer N" where N is the line number -of the line containing the word "season". -The file is too long for you to print it all, -by the way. -#create story -All -of -the -Big -Cats, -as -well -as -the -lesser -ones, -have -wonderful -eyes. -They -can -see -clearly -even -on -a -dark -night. -this -is -because -of -the -way -they -are -made. -There -is -a -sort -of -window -in -each -eye. -This -window -is -called -the -pupil. -It -is -black -and -is -placed -in -the -center -of -the -colored -part -of -the -eye. -The -pupil -lets -light -come -in -and -reach -a -kind -of -mirror -at -the -back -of -each -eye. -These -mirrors -reflect -everything -that -is -in -front -of -the -eyes. -Right -away -a -special -nerve -carries -these -reflected -pictures -to -the -brain. -I'm -learning -to -be -a -detective --- -not -the -kind -who -solves -crimes -from -fingerprints, -pieces -of -clothing, -or -the -cross-examining -of -witnesses --- -I'm -learning -to -be -a -nature -detective. -The -mysteries -I -trace -happen -in -the -woods, -in -the -park, -and -in -my -own -backyard. -Animals -come -and -go -when -I'm -not -there -to -see -them, -but -usually -they -leave -clues -behind. -From -such -clues -and -other -animal -signs, -you -and -I -will -piece -together -some -exciting -stories. -We -will -detect -which -animals -went -where, -what -they -did, -and -sometimes -what -they -ate. -Whenever -there -is -snow -on -the -ground, -you -are -sure -to -find -track -stories -written -in -it. -Animals -travel -by -air -by -water -and -by -land. -Some -run -very -fast. -Some -hop -or -jump -along -the -ground. -Others -walk -more -slowly, -or -crawl -still -more -slowly. -Do -you -know -that -plants -are -travelers, -too? -And -that -they -also -travel -by -land, -by -water -and -by -air? -Most -plants -stay -in -the -same -spot -from -the -time -they -begin -to -grow -until -they -die. -But -the -next -season -you -find -many -of -them -growing -in -new -places. -How -do -they -get -there? -Some -plants -travel -by -land. -They -have -seeds -that -fall -to -the -ground -and -grow -there. -Others -send -out -offshoots -or -sprouts -which -start -new -plants -nearby. -#copyin -#user -#uncopyin -#match 286 -#log -#next -50.2g 10 diff --git a/usr.bin/learn/lib/editor/L50.2g b/usr.bin/learn/lib/editor/L50.2g deleted file mode 100644 index 3690bbb08d7..00000000000 --- a/usr.bin/learn/lib/editor/L50.2g +++ /dev/null @@ -1,52 +0,0 @@ -#print -The file "amend" contains an erroneous copy of the first -four amendments to the Constitution. Find the line -saying "suspicion" and change it to read -"but upon probable cause, supported by oath or affirmation," -and then rewrite the file and type "ready". -#create Ref -1. Congress shall make no law respecting an establishment of religion, -or prohibiting the free exercise thereof; or abridging the freedom of speech, -or of the press; or the right of the people peaceably to assemble, -and to petition the Government for a redress of grievances. - -2. A well regulated Militia, being necessary to the security -of a free State, the right of the people to keep and bear arms -shall not be infringed. - -3. No Soldier shall, in time of peace, be quartered -in any house without the consent of the Owner, nor in time -of war, but in a manner to be prescribed by law. - -4. The right of the people to be secure in their persons, -houses, papers, and effects, against unreasonable searches and -seizures, shall not be violated, and no Warrants shall issue, -but upon probable cause, supported by oath or affirmation, -and particularly describing the place to be searched, and the -persons or things to be seized. -#create amend -1. Congress shall make no law respecting an establishment of religion, -or prohibiting the free exercise thereof; or abridging the freedom of speech, -or of the press; or the right of the people peaceably to assemble, -and to petition the Government for a redress of grievances. - -2. A well regulated Militia, being necessary to the security -of a free State, the right of the people to keep and bear arms -shall not be infringed. - -3. No Soldier shall, in time of peace, be quartered -in any house without the consent of the Owner, nor in time -of war, but in a manner to be prescribed by law. - -4. The right of the people to be secure in their persons, -houses, papers, and effects, against unreasonable searches and -seizures, shall not be violated, and no Warrants shall issue, -but upon suspicion, -and particularly describing the place to be searched, and the -persons or things to be seized. -#user -#cmp amend Ref -#log -#next -51.1a 10 -51.2a 5 diff --git a/usr.bin/learn/lib/editor/L51.1a b/usr.bin/learn/lib/editor/L51.1a deleted file mode 100644 index 3012c3492ad..00000000000 --- a/usr.bin/learn/lib/editor/L51.1a +++ /dev/null @@ -1,25 +0,0 @@ -#print -You can also use relative addresses of the +1 or -1 -sort with context searches. For example, to -print the line after a line containing "cat", -you can say - /cat/+1p -How would you print the line before the next line -containing the word "help" at the beginning -of the line? Try some experiments if you want, -but in the end type "answer COMMAND" where COMMAND -is the correct command to do that. -#copyin -#user -#uncopyin -#match /^help/-1p -#match /^help/-1 -#match /^help/- -#match /^help/-p -#succeed -The "p" isn't necessary, of course. -#cmp X1 X2 -#log -#next -52.1a 10 -52.2a 5 diff --git a/usr.bin/learn/lib/editor/L51.2a b/usr.bin/learn/lib/editor/L51.2a deleted file mode 100644 index 5b1ffb2e3c9..00000000000 --- a/usr.bin/learn/lib/editor/L51.2a +++ /dev/null @@ -1,83 +0,0 @@ -#print -You can also use relative addresses of the +1 or -1 -sort with context searches. For example, to print the -line after the line containing "cat", you could say - - /cat/+1p - -Here is a file "text". Print the line before the line -containing "florin". Then leave the editor and type "ready". -#create text - The United Netherlands are a confederacy of republics, -or rather of aristocracies of a very remarkable texture, yet -confirming all the lessons derived from those which we -have already reviewed. - The union is composed of seven coequal and sovereign -states, and each state or province is a composition of -equal and independent cities. In all important cases, not -only the provinces but the cities must be unanimous. - The sovereignty of the union is represented by the -States-General, consisting usually of about fifty deputies -appointed by the provinces. They hold their seats, some -for life, some for six, three, and one years; from two -provinces they continue in appointment during pleasure. - The States-General have authority to enter into -treaties and alliances; to make war and peace; to raise -armies and equip fleets; to ascertain quotas and -demand contributions. In all these cases, however, unanimity -and sanction of their constituents are requisite. -They have authority to appoint and receive ambassadors; -to execute treaties and alliances already formed; to -provide for the collection of duties on imports and exports; -to regulate the mint with a saving to the provincial -rights; to govern as sovereigns the dependent territories. -The provinces are restrained, unless with the general -consent, from entering into foreign treaties; from -establishing imposts injurious to others, or charging -their neighbors with higher duties than their own subjects. A -council of state, a chamber of accounts, with five colleges -of admiralty, aid and fortify the federal administration. - The executive magistrate of the Union is the -stadtholder, who is now an hereditary prince. His principal -weight and influence in the republic are derived from his -independent title; from his great patrimonial estates; -from his family connections with some of the chief -potentates of Europe; and, more that all, perhaps, from his -being stadtholder in the several provinces, as well as for -the Union; in which provincial quality he has the -appointment of town magistrates under certain regulations, -executes provincial decrees, presides when he pleases in -the provincial tribunals, and has throughout the power -of pardon. - As stadtholder of the Union, he has, however, -considerable prerogatives. - In his political capacity he has authority to settle -disputes between the provinces, when other methods fail; to -assist at the deliberations of the States-General and at -their particular conferences; to give audiences to foreign -ambassadors and to keep agents for his particular affairs -at foreign courts. - In his military capacity he commands the federal -troops, provides for garrisons, and in general regulates -military affairs; disposes of all appointments, from -colonels to ensigns, and of the governments and posts of -fortified towns. - In his marine capacity he is admiral-general and -superintends and directs every thing relative to naval forces -and other naval affairs; presides in the admiralties in -person or by proxy; appoints lieutenant-admirals and -other officers; and establishes councils of war, whose -sentences are not executed till he approves them. - His revenue, exclusive of his private income, amounts -to 300,000 florins. The standing army which he commands -consists of about 40,000 men. -#create x2 - His revenue, exclusive of his private income, amounts -#copyout -#user -#uncopyout -grep exclusive .ocopy >x1 -#cmp x1 x2 -#log -#next -51.2b 5 diff --git a/usr.bin/learn/lib/editor/L51.2b b/usr.bin/learn/lib/editor/L51.2b deleted file mode 100644 index 0d093f3ef0d..00000000000 --- a/usr.bin/learn/lib/editor/L51.2b +++ /dev/null @@ -1,21 +0,0 @@ -#print -Suppose you have a memo in a file and -the line with the title is preceded by a line -with "TL" on it. What command would print -the title? Reply - -answer COMMAND - -where COMMAND is the search-and-print command to do that. -#copyin -#user -#uncopyin -#match /TL/+1p -#match /TL/+ -#match /TL/1 -#match /TL/1p -#match /TL/+p -#match /TL/+1 -#log -#next -51.2c 5 diff --git a/usr.bin/learn/lib/editor/L51.2c b/usr.bin/learn/lib/editor/L51.2c deleted file mode 100644 index 7f42ccacb1c..00000000000 --- a/usr.bin/learn/lib/editor/L51.2c +++ /dev/null @@ -1,93 +0,0 @@ -#print -How would you look for a blank line? Do you -understand - - /^$/p - -Note this command: it looks for the beginning of the -line, followed immediately by the end of the line. If -there are any characters in between, it will keep -looking for a line with no__ characters at all. All right. -The file "text" contains an extraneous blank line. -Delete it and rewrite the file. -#create Ref - When the people of America reflect that they are now -called upon to decide a question, which in its consequences -must prove one of the most important that ever -engaged their attention, the propriety of their taking a -very comprehensive, as well as a very serious, view of it -will be evident. - Nothing is more certain than the indispensable necessity -of government; and it is equally undeniable that -whenever and however it is instituted, the people must -cede to it some of their natural rights, in order to vest it -with requisite powers. It is well worthy of consideration, -therefore, whether it would conduce more to the interest -of the people of America that they should, to all -general purposes, be one nation, under one federal government, -than that they should divide themselves into -separate confederacies and give to the head of each the -same kind of powers which they are advised to place in -one national government. - It has until lately been a received and uncontradicted -opinion that the prosperity of the people of America -depended on their continuing firmly united, and the wishes, -prayers, and efforts of our best and wisest citizens have -been constantly directed to that object. But politicians -now appear who insist that this opinion is erroneous, -and that instead of looking for safety and happiness in -union, we ought to seek it in a division of the States -into distinct confederacies or sovereignties. However -extraordinary this new doctrine may appear, it nevertheless -has its advocates; and certain characters who were -much opposed to it formerly are at present of the number. -Whatever may be the arguments or inducements -which have wrought this change in the sentiments and -declarations of these gentlemen, it certainly would not be -wise in the people at large to adopt these new political -tenets without being fully convinced that they are founded -in truth and sound policy. -#create text - When the people of America reflect that they are now -called upon to decide a question, which in its consequences -must prove one of the most important that ever -engaged their attention, the propriety of their taking a -very comprehensive, as well as a very serious, view of it -will be evident. - Nothing is more certain than the indispensable necessity -of government; and it is equally undeniable that -whenever and however it is instituted, the people must -cede to it some of their natural rights, in order to vest it -with requisite powers. It is well worthy of consideration, -therefore, whether it would conduce more to the interest -of the people of America that they should, to all -general purposes, be one nation, under one federal government, -than that they should divide themselves into -separate confederacies and give to the head of each the -same kind of powers which they are advised to place in -one national government. - It has until lately been a received and uncontradicted -opinion that the prosperity of the people of America -depended on their continuing firmly united, and the wishes, -prayers, and efforts of our best and wisest citizens have -been constantly directed to that object. But politicians -now appear who insist that this opinion is erroneous, -and that instead of looking for safety and happiness in -union, we ought to seek it in a division of the States -into distinct confederacies or sovereignties. However -extraordinary this new doctrine may appear, it nevertheless -has its advocates; and certain characters who were -much opposed to it formerly are at present of the number. -Whatever may be the arguments or inducements -which have wrought this change in the sentiments and -declarations of these gentlemen, it certainly would not be -wise in the people at large to adopt these new political - -tenets without being fully convinced that they are founded -in truth and sound policy. -#user -#cmp Ref text -#log -#next -52.1a 10 -52.2a 5 diff --git a/usr.bin/learn/lib/editor/L52.1a b/usr.bin/learn/lib/editor/L52.1a deleted file mode 100644 index c1d36b76692..00000000000 --- a/usr.bin/learn/lib/editor/L52.1a +++ /dev/null @@ -1,71 +0,0 @@ -#print -A very powerful tool is to use pairs of addresses -which include searches. For example, to print -all lines from the present line to the next line -containing "stop", say - .,/stop/p -(remember that "." is the present line). In this -directory is a file "outline". Find the line that -begins "B.3.i". Note that this line, and the next -few lines, should begin "A..." for consistency. -(Print the whole file to see what's wrong). -Change all lines from this line to -the line beginning "B.3.v" to begin "A.3". -Then rewrite the file and type "ready". -#create Ref -First section -A.1.i Introduction -A.1.ii Definitions -Second section -A.2.i Scope -A.2.ii Date effective -A.2.iii Who covered -Third section -A.3.i Governing committee -A.3.ii Chairman's election -A.3.iii Board terms -A.3.iv Board elections -A.3.v Removal procedure -Fourth section -A.4.i Meetings -A.4.ii Place of meeting -A.4.iii Frequency of meetings -Fifth section -A.5.i Record keeping -A.5.ii Corresponding secretary -A.5.iii Recording secretary -A.5.iv Financial records -#create outline -First section -A.1.i Introduction -A.1.ii Definitions -Second section -A.2.i Scope -A.2.ii Date effective -A.2.iii Who covered -Third section -B.3.i Governing committee -B.3.ii Chairman's election -B.3.iii Board terms -B.3.iv Board elections -B.3.v Removal procedure -Fourth section -A.4.i Meetings -A.4.ii Place of meeting -A.4.iii Frequency of meetings -Fifth section -A.5.i Record keeping -A.5.ii Corresponding secretary -A.5.iii Recording secretary -A.5.iv Financial records -#user -#cmp outline Ref -#succeed -You got it right: I hope you found that the easiest -way to change the file would be with the commands - /B.3.i/p - .,/B.3.v/s/B/A/ -or some such series. -#log -#next -52.1b 10 diff --git a/usr.bin/learn/lib/editor/L52.1b b/usr.bin/learn/lib/editor/L52.1b deleted file mode 100644 index 2ccba77de9a..00000000000 --- a/usr.bin/learn/lib/editor/L52.1b +++ /dev/null @@ -1,60 +0,0 @@ -#print -Even more powerful is to use two context -searches for the pair of addresses -in front of a command. For example - /abc/,/def/p -will print all lines from the one that -contains "abc" to the one that contains -"def". In this directory is a file -"phone". On every line between -"Pinson" and "Johnson" change "tel" to "ext". -(Again, print the whole file first to see -what's going on here and why the file is bad.) -Then rewrite the corrected file and -type "ready". -#create Ref - telephone numbers - -McIlroy M D ext 6050 -Aho A V ext 4862 -Baker B S ext 6503 -Cherry L L ext 6067 -Knowlton K ext 2328 -Morris R ext 3878 -Ossanna J F ext 3520 -Thompson K ext 2394 - -Pinson E N ext 2582 -Bourne S R ext 7419 -Elliot R J ext 2879 -Fraser A G ext 3685 -Johnson S C ext 3968 -Kernighan B W ext 6021 -Ritchie D M ext 3770 -Vollaro J R ext 6321 -#create phone - telephone numbers - -McIlroy M D ext 6050 -Aho A V ext 4862 -Baker B S ext 6503 -Cherry L L ext 6067 -Knowlton K ext 2328 -Morris R ext 3878 -Ossanna J F ext 3520 -Thompson K ext 2394 - -Pinson E N tel 2582 -Bourne S R tel 7419 -Elliot R J tel 2879 -Fraser A G tel 3685 -Johnson S C tel 3968 -Kernighan B W ext 6021 -Ritchie D M ext 3770 -Vollaro J R ext 6321 -#user -#cmp phone Ref -#log -#next -53.1a 10 -52.2c 5 diff --git a/usr.bin/learn/lib/editor/L52.2a b/usr.bin/learn/lib/editor/L52.2a deleted file mode 100644 index f8858c6f9dd..00000000000 --- a/usr.bin/learn/lib/editor/L52.2a +++ /dev/null @@ -1,61 +0,0 @@ -#print -You can use pairs of addresses which involve searches. For example, -to print all lines from the first line until the next line containing -"stop", say - - 1,/stop/p - -In this directory is a file "list". Print all lines from -the first line to a line containing "023". Then leave the editor -and type "ready". -#create list -bio011 -bio012 -bio013 -bio014 -bio015 -bio016 -bio017 -bio021 -bio022 -bio023 -bio024 -bio025 -bio026 -bio027 -bio028 -bio031 -bio032 -bio033 -bio034 -bio035 -bio036 -bio037 -bio038 -bio041 -bio042 -bio043 -bio044 -bio045 -bio046 -bio047 -bio051 -#create x2 -bio011 -bio012 -bio013 -bio014 -bio015 -bio016 -bio017 -bio021 -bio022 -bio023 -#copyout -#user -#uncopyout -grep bio .ocopy >x1 -#cmp x1 x2 -#log -#next -52.2b 5 diff --git a/usr.bin/learn/lib/editor/L52.2b b/usr.bin/learn/lib/editor/L52.2b deleted file mode 100644 index ce292b2b289..00000000000 --- a/usr.bin/learn/lib/editor/L52.2b +++ /dev/null @@ -1,65 +0,0 @@ -#print -In this directory is a file "outline". Find the line that -begins "B.3.i". Note that this line, and the next few -lines, should begin "A"... for consistency. -(Print the whole file to see what is going on. It's fairly short.) -Change all lines from the line beginning "B.3.i" to the line -beginning "B.3.v" to begin "A.3". Then rewrite the file -and type "ready". -#create Ref -First section -A.1.i Introduction -A.1.ii Definitions -Second section -A.2.i Scope -A.2.ii Date effective -A.2.iii Who covered -Third section -A.3.i Governing committee -A.3.ii Chairman's election -A.3.iii Board terms -A.3.iv Board elections -A.3.v Removal procedure -Fourth section -A.4.i Meetings -A.4.ii Place of meeting -A.4.iii Frequency of meetings -Fifth section -A.5.i Record keeping -A.5.ii Corresponding secretary -A.5.iii Recording secretary -A.5.iv Financial records -#create outline -First section -A.1.i Introduction -A.1.ii Definitions -Second section -A.2.i Scope -A.2.ii Date effective -A.2.iii Who covered -Third section -B.3.i Governing committee -B.3.ii Chairman's election -B.3.iii Board terms -B.3.iv Board elections -B.3.v Removal procedure -Fourth section -A.4.i Meetings -A.4.ii Place of meeting -A.4.iii Frequency of meetings -Fifth section -A.5.i Record keeping -A.5.ii Corresponding secretary -A.5.iii Recording secretary -A.5.iv Financial records -#user -#cmp outline Ref -#succeed -You got it right: I hope you found that the easiest -way to change the file would be with the commands - /B.3.i/p - .,/B.3.v/s/B/A/ -or some such series. -#log -#next -52.1b 10 diff --git a/usr.bin/learn/lib/editor/L52.2c b/usr.bin/learn/lib/editor/L52.2c deleted file mode 100644 index b9d31ba624c..00000000000 --- a/usr.bin/learn/lib/editor/L52.2c +++ /dev/null @@ -1,56 +0,0 @@ -#print -In this directory is a file "memo". Between the line -containing "I." and the line containing "II." -change all multiple blanks to one blank. -Then rewrite the file and type "ready". -#create Ref -.TL -The Time Has Come -.AU -Joe Idiot -.AI -Bell Labs -Murray Hill, NJ 07974 -.SH -I. Introduction -.PP -This document describes the problems of -designing complex systems without adequately -trained manpower. The solution adopted was -to trick 90% of the staff into thinking they -were working on the system when in fact they were not. -This let the remaining 1:0% of the staff actually get -the thing built. -.SH -II. Details -.PP -The project began on June 1, 1974. It was completed -on Sept. 1, 1975 and has worked successfully since then. -#create memo -.TL -The Time Has Come -.AU -Joe Idiot -.AI -Bell Labs -Murray Hill, NJ 07974 -.SH -I. Introduction -.PP -This document describes the problems of -designing complex systems without adequately -trained manpower. The solution adopted was -to trick 90% of the staff into thinking they -were working on the system when in fact they were not. -This let the remaining 1:0% of the staff actually get -the thing built. -.SH -II. Details -.PP -The project began on June 1, 1974. It was completed -on Sept. 1, 1975 and has worked successfully since then. -#user -#cmp memo Ref -#log -#next -53.1a 10 diff --git a/usr.bin/learn/lib/editor/L53.1a b/usr.bin/learn/lib/editor/L53.1a deleted file mode 100644 index c3c5a8b0499..00000000000 --- a/usr.bin/learn/lib/editor/L53.1a +++ /dev/null @@ -1,22 +0,0 @@ -#print -Note that the // searches always go forward. -Sometimes you want to go backward, to find -some expression on a line before the -one you are now working on. -In that case you can search with a command like - ?abc?p -which prints the nearest preceding line which -contains 'abc'. What command would print -the nearest previous line that ends in "cat"? -Type "answer COMMAND" when you figure it out. -#copyin -#user -#uncopyin -#match ?cat$?p -The "p" isn't needed, but use it if you like too. -#match ?cat$? -#cmp X1 X2 -#log -#next -54.1a 10 -53.2b 7 diff --git a/usr.bin/learn/lib/editor/L53.2b b/usr.bin/learn/lib/editor/L53.2b deleted file mode 100644 index f3b131513e3..00000000000 --- a/usr.bin/learn/lib/editor/L53.2b +++ /dev/null @@ -1,416 +0,0 @@ -#print -There is a big file "federal" in this directory. -It contains the following mistyped words: - Typed as Should be -cotnend contend -aalarm alarm -exedient expedient -drabel durable -ugdes judges -trame trample -viws views - -Fix things up, rewrite the file, and then type "ready". -#create Ref -Among the numerous advantages promised by a well-constructed -Union, none deserves to be more accurately -developed than its tendency to break and control the violence -of faction. -The friend of popular governments never finds himself -so much alarmed for their character and fate as when he -contemplates their propensity to this dangerous vice. -He will not fail, therefore, to set a due value on -any plan which, without violating the principles to which -he is attached, provides a proper cure for it. -The instability, injustice, and confusion introduced into the public -councils have, in truth, been the mortal diseases under -which popular governments have everywhere perished, as -they continue to be the favorite and fruitful topics from -which the adversaries to liberty derive their most specious -declamations. -The valuable improvements made by the American constitutions -on the popular models, both ancient -and modern, cannot certainly be too much admired; -but it would be an unwarrantable partiality to contend -that they have as effectually obviated the danger on this -side, as was wished and expected. -Complaints are everywhere heard from our most considerate and virtuous -citizens, equally the friends of public and private faith -and of public and personal liberty, that out governments -are too unstable, that the public good is disregarded in -the conflicts of rival parties, and that measures are too -often decided, not according to the rules of justice and -the rights of the minor party, but by the superior force -of an interested and overbearing majority. -However anxiously we may wish that these complaints had no -foundation, the evidence of known facts will not permit -us to deny that they are in some degree true. -It will be found, indeed, on a candid review of our situation, that -some of the distresses under which we labor have been -erroneously charged on the operation of our governments; -but it will be found, at the same time, that other -causes will not alone account for many of our heaviest -misfortunes; and, particularly, for that prevailing and increasing -distrust of public engagements and alarm for -private rights which are echoed from one end of the -continent to the other. -These must be chiefly, if not wholly, -effects of the unsteadiness and injustice with -which a factious spirit has tainted out public administration. - By a faction I understand a number of citizens, -whether amounting to a majority or minority of the whole, -who are united and actuated by some common impulse -of passion, or of interest, adverse to the rights of other -citizens, or to the permanent and aggregate interests of -the community. - There are two methods of curing the mischiefs of -faction: The one, -by removing its causes; the other, by controlling -its effects. - There are again two methods of removing the causes of faction: -The one, by destroying the liberty which is essential to its existence; -The other, by giving to every -citizen the same opinions, the same passions, and the -same interests. - It could never be more truly said than of the first -remedy that it was worse than the disease. -Liberty is to -faction what air is to fire, an ailment without which it -instantly expires. -But it could not be less folly to -abolish liberty, which is essential to political life, -because it nourishes faction than it would be to wish the -annihilation of air, which is essential to animal life, -because it imparts to dire its destructive agency. - The second expedient is as impracticable as the first -would be unwise. -As long as the reason of man continues -fallible, and he is at liberty to exercise it, different -opinions will be formed. -As long as the connection subsists -between his reason and his self-love, his opinions and his -passions will have a reciprocal influence on each other; -and the former will be objects to which the latter will -attach themselves. -The diversity in the faculties of men, -from which the rights of property originate, is not less an -insuperable obstacle to the uniformity of interests. -The protection of these faculties is the first object of -government. -From the protection of different and unequal -faculties of acquiring property, the possession of -different degrees and kinds of property immediately results; -and from the influence of these on the sentiments and views -of the respective proprietors ensues a division of the -society into different interests and parties. - The latent causes of faction are thus sown in the -nature of man; and we see them everywhere brought -into different degrees of activity, according to the -different circumstances of civil society. -A zeal for different opinions -concerning religion, concerning government, and -many other points, as well of speculation as of practice; -an attachment to different leaders ambitiously contending -for pre-eminence and power; or to persons of other -descriptions whose fortunes have been interesting to the -human passions, have, in turn, divided mankind into -parties, inflamed them with mutual animosity, and -rendered them much more disposed to vex and oppress each -other than to co-operate for their common goal. -So strong is this propensity of mankind to fall into mutual -animosities that where no substantial occasion presents -itself the most frivolous and fanciful distinctions have -been sufficient to kindle their unfriendly passions and -excite their most violent conflicts. -But the most common and durable -source of factions has been the verious -and unequal distribution of property. -Those who hold and those who are without -property have ever formed distinct -interests in society. -Those who are creditors, and those -who are debtors, fall under a like discrimination. -A landed interest, a manufacturing interest, -a mercantile interest, a moneyed interest, -with many lesser interests, grow up of -necessity in civilized nations, and divided them into -different classes, actuated by different sentiments and views. -The regulation of these various and interfering interests -involves the spirit of party and faction in the necessary -and ordinary operations of government. - No man is allowed to be a judge in has own cause, -because his interest would certainly bias his judgement, -and, not improbably, corrupt his integrity. -With equal, nay with greater reason, a body -of men are unfit to be both judges and parties at the same time; -yet what are many of the most important acts of -legislation but so many judicial determinations, -not indeed concerning the -rights of single person, but concerning the rights of large -bodies of citizens? -And what are the different classes of legislators but -advocates and parties to the causes which -they determine? -Is a law proposed concerning private -debts? -It is a question to which the creditors are parties -one one side and the debtors on the other. -Justice ought to hold the balance -between them. -Yet the parties are, and must be, -themselves the judges; and the most numerous -party, or in other words, the most powerful faction must -be expected to prevail. -Shall domestic manufacturers be -encouraged, and in what degree, by restrictions on foreign -manufacturers? -are questions which would be differently -decided by the landed and the manufacturing classes, and -probably by neither with a sole regard to justice and the -public good. -The apportionment of taxes on the various -descriptions of property is an act which seems to require -the most exact impartiality; yet there is, perhaps, no -legislative act in which greater opportunity and -temptation are given to a predominant party to trample on the -rules of justice. -Every shilling with which they overburden the inferior -number is a shilling saved to their own pockets. - It is in vain to say that enlightened statesmen will be -able to adjust these clashing interests and render them -all subservient to the public good. -Enlightened statesmen will not -always be at the helm. -Nor, in many cases, can -such an adjustment be made at all without taking into -view indirect and remote considerations, which will rarely -prevail over the immediate interest which one party may -find in disregarding the rights of another or the good of -the whole. - The inference to which we are brought is that the causes -of faction cannot be removed and that relief is only to be -sought in the means of controlling its effects. - If a faction consists of less than a majority, relief is -supplied by the republican principle, which enables the -majority to defeat its sinister views by regular vote. -It may clog the administration, it may convulse the society; -But it will be unable to execute and mask its violence -under the forms of the Constitution. -When a majority is included in a faction, -The form of popular government, on -the other hand, enables it to sacrifice to its ruling passion -or interest both the public good and the rights of other -citizens. -To secure the public good and private rights -against the danger of such a faction, and at the same -time to preserve the spirit and form of popular -government, is than the great object to which our inquiries -are directed. -Let me add that it is the great desideratum by which -alone this form of government can be rescued from -the opprobrium under which it has so long labored and -be recommended to the esteem and adoption of mankind. -#create federal -Among the numerous advantages promised by a well-constructed -Union, none deserves to be more accurately -developed than its tendency to break and control the violence -of faction. -The friend of popular governments never finds himself -so much alarmed for their character and fate as when he -contemplates their propensity to this dangerous vice. -He will not fail, therefore, to set a due value on -any plan which, without violating the principles to which -he is attached, provides a proper cure for it. -The instability, injustice, and confusion introduced into the public -councils have, in truth, been the mortal diseases under -which popular governments have everywhere perished, as -they continue to be the favorite and fruitful topics from -which the adversaries to liberty derive their most specious -declamations. -The valuable improvements made by the American constitutions -on the popular models, both ancient -and modern, cannot certainly be too much admired; -but it would be an unwarrantable partiality to cotnend -that they have as effectually obviated the danger on this -side, as was wished and expected. -Complaints are everywhere heard from our most considerate and virtuous -citizens, equally the friends of public and private faith -and of public and personal liberty, that out governments -are too unstable, that the public good is disregarded in -the conflicts of rival parties, and that measures are too -often decided, not according to the rules of justice and -the rights of the minor party, but by the superior force -of an interested and overbearing majority. -However anxiously we may wish that these complaints had no -foundation, the evidence of known facts will not permit -us to deny that they are in some degree true. -It will be found, indeed, on a candid review of our situation, that -some of the distresses under which we labor have been -erroneously charged on the operation of our governments; -but it will be found, at the same time, that other -causes will not alone account for many of our heaviest -misfortunes; and, particularly, for that prevailing and increasing -distrust of public engagements and aalarm for -private rights which are echoed from one end of the -continent to the other. -These must be chiefly, if not wholly, -effects of the unsteadiness and injustice with -which a factious spirit has tainted out public administration. - By a faction I understand a number of citizens, -whether amounting to a majority or minority of the whole, -who are united and actuated by some common impulse -of passion, or of interest, adverse to the rights of other -citizens, or to the permanent and aggregate interests of -the community. - There are two methods of curing the mischiefs of -faction: The one, -by removing its causes; the other, by controlling -its effects. - There are again two methods of removing the causes of faction: -The one, by destroying the liberty which is essential to its existence; -The other, by giving to every -citizen the same opinions, the same passions, and the -same interests. - It could never be more truly said than of the first -remedy that it was worse than the disease. -Liberty is to -faction what air is to fire, an ailment without which it -instantly expires. -But it could not be less folly to -abolish liberty, which is essential to political life, -because it nourishes faction than it would be to wish the -annihilation of air, which is essential to animal life, -because it imparts to dire its destructive agency. - The second exedient is as impracticable as the first -would be unwise. -As long as the reason of man continues -fallible, and he is at liberty to exercise it, different -opinions will be formed. -As long as the connection subsists -between his reason and his self-love, his opinions and his -passions will have a reciprocal influence on each other; -and the former will be objects to which the latter will -attach themselves. -The diversity in the faculties of men, -from which the rights of property originate, is not less an -insuperable obstacle to the uniformity of interests. -The protection of these faculties is the first object of -government. -From the protection of different and unequal -faculties of acquiring property, the possession of -different degrees and kinds of property immediately results; -and from the influence of these on the sentiments and views -of the respective proprietors ensues a division of the -society into different interests and parties. - The latent causes of faction are thus sown in the -nature of man; and we see them everywhere brought -into different degrees of activity, according to the -different circumstances of civil society. -A zeal for different opinions -concerning religion, concerning government, and -many other points, as well of speculation as of practice; -an attachment to different leaders ambitiously contending -for pre-eminence and power; or to persons of other -descriptions whose fortunes have been interesting to the -human passions, have, in turn, divided mankind into -parties, inflamed them with mutual animosity, and -rendered them much more disposed to vex and oppress each -other than to co-operate for their common goal. -So strong is this propensity of mankind to fall into mutual -animosities that where no substantial occasion presents -itself the most frivolous and fanciful distinctions have -been sufficient to kindle their unfriendly passions and -excite their most violent conflicts. -But the most common and drabel -source of factions has been the verious -and unequal distribution of property. -Those who hold and those who are without -property have ever formed distinct -interests in society. -Those who are creditors, and those -who are debtors, fall under a like discrimination. -A landed interest, a manufacturing interest, -a mercantile interest, a moneyed interest, -with many lesser interests, grow up of -necessity in civilized nations, and divided them into -different classes, actuated by different sentiments and views. -The regulation of these various and interfering interests -involves the spirit of party and faction in the necessary -and ordinary operations of government. - No man is allowed to be a judge in has own cause, -because his interest would certainly bias his judgement, -and, not improbably, corrupt his integrity. -With equal, nay with greater reason, a body -of men are unfit to be both ugdes and parties at the same time; -yet what are many of the most important acts of -legislation but so many judicial determinations, -not indeed concerning the -rights of single person, but concerning the rights of large -bodies of citizens? -And what are the different classes of legislators but -advocates and parties to the causes which -they determine? -Is a law proposed concerning private -debts? -It is a question to which the creditors are parties -one one side and the debtors on the other. -Justice ought to hold the balance -between them. -Yet the parties are, and must be, -themselves the judges; and the most numerous -party, or in other words, the most powerful faction must -be expected to prevail. -Shall domestic manufacturers be -encouraged, and in what degree, by restrictions on foreign -manufacturers? -are questions which would be differently -decided by the landed and the manufacturing classes, and -probably by neither with a sole regard to justice and the -public good. -The apportionment of taxes on the various -descriptions of property is an act which seems to require -the most exact impartiality; yet there is, perhaps, no -legislative act in which greater opportunity and -temptation are given to a predominant party to trame on the -rules of justice. -Every shilling with which they overburden the inferior -number is a shilling saved to their own pockets. - It is in vain to say that enlightened statesmen will be -able to adjust these clashing interests and render them -all subservient to the public good. -Enlightened statesmen will not -always be at the helm. -Nor, in many cases, can -such an adjustment be made at all without taking into -view indirect and remote considerations, which will rarely -prevail over the immediate interest which one party may -find in disregarding the rights of another or the good of -the whole. - The inference to which we are brought is that the causes -of faction cannot be removed and that relief is only to be -sought in the means of controlling its effects. - If a faction consists of less than a majority, relief is -supplied by the republican principle, which enables the -majority to defeat its sinister viws by regular vote. -It may clog the administration, it may convulse the society; -But it will be unable to execute and mask its violence -under the forms of the Constitution. -When a majority is included in a faction, -The form of popular government, on -the other hand, enables it to sacrifice to its ruling passion -or interest both the public good and the rights of other -citizens. -To secure the public good and private rights -against the danger of such a faction, and at the same -time to preserve the spirit and form of popular -government, is than the great object to which our inquiries -are directed. -Let me add that it is the great desideratum by which -alone this form of government can be rescued from -the opprobrium under which it has so long labored and -be recommended to the esteem and adoption of mankind. -#user -#cmp federal Ref -#log -#next -54.1a 10 diff --git a/usr.bin/learn/lib/editor/L54.1a b/usr.bin/learn/lib/editor/L54.1a deleted file mode 100644 index d813f6e2841..00000000000 --- a/usr.bin/learn/lib/editor/L54.1a +++ /dev/null @@ -1,40 +0,0 @@ -#print -A time-saving feature of context searches is -that the editor remembers the last regular expression -mentioned, and if you just say // or ?? -with no expression, it assumes the same one. Thus - /abc/s//def/ -searches for a line with 'abc', and, on finding it, -changes the 'abc' to 'def'. Similarly - /qqq/s/// -finds a 'qqq' and then throws it away, as if the -command were - /qqq/s/qqq// -In this directory is a file 'error' which contains -"servixe" as a mistyping for "service". Find -the bad instance and fix it, if possible with one command. -Then rewrite the file and type 'ready'. -#create Ref -This file contains many copies -of the word service -but in all of those lines -with service in them -the next line has a -service that is spelled -wrong unlike the other -services. -#create error -This file contains many copies -of the word service -but in all of those lines -with service in them -the next line has a -servixe that is spelled -wrong unlike the other -services. -#user -#cmp error Ref -#log -#next -55.1a 10 -54.1b 8 diff --git a/usr.bin/learn/lib/editor/L54.1b b/usr.bin/learn/lib/editor/L54.1b deleted file mode 100644 index 0f90c390660..00000000000 --- a/usr.bin/learn/lib/editor/L54.1b +++ /dev/null @@ -1,43 +0,0 @@ -#print -The fact that the system remembers the last regular expression -it had is particularly useful when the regular expression is -complex. Suppose, for example, you know that the -words "first" and "second" appear on the same line and you wish -to delete them and everything between them. You could write - /first.*second/s/first.*second//p -but isn't it easier to do - /first.*second/s///p -Edit the file "passage"; the words "twentieth" and "impending" appear -on the same line. Replace them and everything between -them by the word "impending" (i.e. delete from "twentieth" -up to but not including "impending"). One command, if you can. -Then rewrite the file and type ready. -#create Ref - America's rise to world power is a consequence of the nation's -geographic position, natural resources, and dynamic energy. For -the first century and more of national history, however, continental -expansion and internal developments largely absorbed the energies -of the American people. Every dictate of public interest emphasized -the importance of avoiding all entanglements that might involve the -young republic in foreign rivalries and foreign wars. Only with the -impending shifts -in the European balance of power, and the growth of American economic -and industrial strength create a situation that made impossible a -continued aloofness from international affairs. -#create passage - America's rise to world power is a consequence of the nation's -geographic position, natural resources, and dynamic energy. For -the first century and more of national history, however, continental -expansion and internal developments largely absorbed the energies -of the American people. Every dictate of public interest emphasized -the importance of avoiding all entanglements that might involve the -young republic in foreign rivalries and foreign wars. Only with the -twentieth century did a rapidly contracting world, impending shifts -in the European balance of power, and the growth of American economic -and industrial strength create a situation that made impossible a -continued aloofness from international affairs. -#user -#cmp passage Ref -#log -#next -55.1a 10 diff --git a/usr.bin/learn/lib/editor/L55.1a b/usr.bin/learn/lib/editor/L55.1a deleted file mode 100644 index 56c8fe59fff..00000000000 --- a/usr.bin/learn/lib/editor/L55.1a +++ /dev/null @@ -1,34 +0,0 @@ -#print -This is an easy unit. If you just hit -"newline" (or "carriage return", whatever it -is labeled on your terminal), the -editor will simply print the next line -as you can see by trying this out. Edit the -file "pres"; print some line; then hit return -or newline, and watch the editor print the -next line. Is there any difference between -newline and ".+1p" as a command? When you -think you know, leave the editor and type "yes" or "no". -#create pres -George Washington -John Adams -Thomas Jefferson -James Madison -James Monroe -John Quincy Adams -Andrew Jackson -Martin van Buren -William Henry Harrison -John Tyler -James K. Polk -Franklin Pierce -Millard Fillmore -James Buchanan -Abraham Lincoln -#copyin -#user -#uncopyin -#match no -#log -#next -56.1a 10 diff --git a/usr.bin/learn/lib/editor/L56.1a b/usr.bin/learn/lib/editor/L56.1a deleted file mode 100644 index 6ac814f95ae..00000000000 --- a/usr.bin/learn/lib/editor/L56.1a +++ /dev/null @@ -1,37 +0,0 @@ -#print -Is there just as easy a way of -printing the immediately preceding line? -Not quite, but almost. The line - -- - -will print the line just before the line you -are on. What's the equivalent command -in terms of "." and "p"? Type "answer COMMAND" -when you figure it out. Again, you can experiment -first; the same file named "pres" is in this directory. -#create pres -George Washington -John Adams -Thomas Jefferson -James Madison -James Monroe -John Quincy Adams -Andrew Jackson -Martin van Buren -William Henry Harrison -John Tyler -James K. Polk -Franklin Pierce -Millard Fillmore -James Buchanan -Abraham Lincoln -#copyin -#user -#uncopyin -#match .-1p -The "p" isn't needed. -#match .-1 -#log -#next -57.1a 10 diff --git a/usr.bin/learn/lib/editor/L57.1a b/usr.bin/learn/lib/editor/L57.1a deleted file mode 100644 index c03026f985c..00000000000 --- a/usr.bin/learn/lib/editor/L57.1a +++ /dev/null @@ -1,48 +0,0 @@ -#print -For symmetry, you can use - -+ - -instead of either ".+1p" or an empty -line (just a newline). The only advantage -that + has is that you can repeat it: - -++ - -prints the second following line, and - -+++ - -the third. The same is true of -. -If the current line is line number 10, -what line number is -- going to be? -(Hint: you can find out by editing a file -such as "pres", saying "10p", and then -saying "--", and then saying ".=" - remember -the "=" command?) -When you find out, type "answer N" where -N is the number. -#create pres -George Washington -John Adams -Thomas Jefferson -James Madison -James Monroe -John Quincy Adams -Andrew Jackson -Martin van Buren -William Henry Harrison -John Tyler -James K. Polk -Franklin Pierce -Millard Fillmore -James Buchanan -Abraham Lincoln -#copyin -#user -#uncopyin -#match 8 -#log -#next -60.1a 10 -60.2a 5 diff --git a/usr.bin/learn/lib/editor/L6.1a b/usr.bin/learn/lib/editor/L6.1a deleted file mode 100644 index 0e697aa59f1..00000000000 --- a/usr.bin/learn/lib/editor/L6.1a +++ /dev/null @@ -1,41 +0,0 @@ -#print -You may well ask how the editor knows which line to print. -The editor keeps track of the 'current line', which -is usually the last line you touched in any way. -When you begin editing a file, for example, the -current line is the last line. -If you want to print any particular line, however, -that is easy. For example, to print the 3rd line you say - -3p - -To print the first line - -1p - -(That's a one, no matter how much it looks like the letter "l".) -Here is a file: I'll put you into the editor -with that file as the 'current file' - print the 4th line, -then type 'w', 'q', and 'ready' as usual. -#create Ref -james madison -91 -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#print file -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -2 .ocopy >X2 -#cmp Ref X2 -#log -#next -7.1a 10 diff --git a/usr.bin/learn/lib/editor/L6.2a b/usr.bin/learn/lib/editor/L6.2a deleted file mode 100644 index 4df8247c58b..00000000000 --- a/usr.bin/learn/lib/editor/L6.2a +++ /dev/null @@ -1,40 +0,0 @@ -#print -How does the editor choose a line to print? -It always remembers a 'current line', which -is the last line of the file originally, -but you can choose any line you want. The command - -3p - -prints the third line of the file, for example. -And - -1p - -prints the first line. Note that is the digit one -there, not the letter l, no matter how much alike they -look. I'll put you into the editor with the -file listed below: print the first line, -then type 'w', 'q' and 'ready' as usual. -#create Ref -george washington -91 -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#print file -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -2 .ocopy >X2 -#cmp Ref X2 -#log -#next -6.2b 5 diff --git a/usr.bin/learn/lib/editor/L6.2b b/usr.bin/learn/lib/editor/L6.2b deleted file mode 100644 index 2c4799682df..00000000000 --- a/usr.bin/learn/lib/editor/L6.2b +++ /dev/null @@ -1,26 +0,0 @@ -#print -Same thing again, but this time print the -fifth line in the file. Then type "w", "q", -and "ready". -#create Ref -james monroe -91 -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#print file -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -2 .ocopy >X2 -#cmp Ref X2 -#log -#next -7.1a 10 diff --git a/usr.bin/learn/lib/editor/L60.1a b/usr.bin/learn/lib/editor/L60.1a deleted file mode 100644 index 78874c87410..00000000000 --- a/usr.bin/learn/lib/editor/L60.1a +++ /dev/null @@ -1,61 +0,0 @@ -#print -So far you have always dealt with one file at a time. -Suppose you wanted to combine two files - there is nothing -we have covered so far that will do that. But the -editor does have a command 'r' (read) - -r file - -which reads in the contents of "file" without throwing -away what you already have. So that you can combine -the files "cat" and "dog" (and name the result "animal") -by saying - -ed -r cat -r dog -w animal -q - -In this directory are four files named -for continents. Combine them into -one file named "world". -(Read the files in alphabetical order, -as they are listed). You may want to list -the input files and the combined files -with "cat" to see what they look like. -When done, type "ready" as usual. -#create Ref -This is file -'africa' and will be listed first. ------- -this file will -have to do -for both american -continents ------ - File "asia" - is indented - two spaces. -Europe's file is only one line long. -#create africa -This is file -'africa' and will be listed first. -#create america ------- -this file will -have to do -for both american -continents ------ -#create asia - File "asia" - is indented - two spaces. -#create europe -Europe's file is only one line long. -#user -#cmp Ref world -#log -#next -60.1b 10 diff --git a/usr.bin/learn/lib/editor/L60.1b b/usr.bin/learn/lib/editor/L60.1b deleted file mode 100644 index b990cc6b51a..00000000000 --- a/usr.bin/learn/lib/editor/L60.1b +++ /dev/null @@ -1,78 +0,0 @@ -#print -You can, of course, use the 'r' command -with an address. Any editor command can be used -with an address (except 'q'). For example, there -is a file 'phone' in this directory. -If you print it, you'll see that one department -is missing from the list; it is on file 'filler'. -Edit 'phone'; read in 'filler' after the line -saying '1273'. Then rewrite 'phone', leave the -editor, and say "ready". -#create Ref - telephone numbers - -Department 1271 -McIlroy M D ext 6050 -Aho A V ext 4862 -Baker B S ext 6503 -Cherry L L ext 6067 -Knowlton K ext 2328 -Morris R ext 3878 -Ossanna J F ext 3520 -Thompson K ext 2394 - -Department 1273 -Pinson E N ext 2582 -Bourne S R ext 7419 -Elliot R J ext 2879 -Fraser A G ext 3685 -Johnson S C ext 3968 -Kernighan B W ext 6021 -Ritchie D M ext 3770 -Vollaro J R ext 6321 - -Department 1274 -Brown W S ext 4822 -Blue J L ext 6558 -Feldman S I ext 2059 -Hall A D ext 4006 -Lesk M E ext 6377 -Schryer N L ext 2912 -Warner D D ext 2833 -#create filler -Pinson E N ext 2582 -Bourne S R ext 7419 -Elliot R J ext 2879 -Fraser A G ext 3685 -Johnson S C ext 3968 -Kernighan B W ext 6021 -Ritchie D M ext 3770 -Vollaro J R ext 6321 -#create phone - telephone numbers - -Department 1271 -McIlroy M D ext 6050 -Aho A V ext 4862 -Baker B S ext 6503 -Cherry L L ext 6067 -Knowlton K ext 2328 -Morris R ext 3878 -Ossanna J F ext 3520 -Thompson K ext 2394 - -Department 1273 - -Department 1274 -Brown W S ext 4822 -Blue J L ext 6558 -Feldman S I ext 2059 -Hall A D ext 4006 -Lesk M E ext 6377 -Schryer N L ext 2912 -Warner D D ext 2833 -#user -#cmp phone Ref -#log -#next -61.1a 10 diff --git a/usr.bin/learn/lib/editor/L60.2a b/usr.bin/learn/lib/editor/L60.2a deleted file mode 100644 index e62296038fc..00000000000 --- a/usr.bin/learn/lib/editor/L60.2a +++ /dev/null @@ -1,60 +0,0 @@ -#print -Suppose you wanted to combine two files? No editor command you -have learned so far will do that. The command 'r' is just what the doctor -ordered. It reads in a file, without throwing away the existing buffer. -So, for example, - ed para1 - r para2 - w both - q -will edit "para1"; then read in "para2" at the end; and then -write the combined stuff on "both". Try that, with those names, -in this directory. Then type "ready". -#create Ref - We say that matter is anything which occupies space and has -weight. Matter possesses inertia, which is a resistance to change -of position or motion. It may be acted on by forces which may set -it in motion, or change its motion. While all these statements -are descriptive of matter, they do not provide us with a completely -satisfactory definition. Scientists, with their great knowledge -of the properties and behavior of matter, are not yet able to -define it precisely. Nature still holds many secrets to challenge -the minds of men. - The quantity of matter which a body possesses is known as its -mass. - When one end of a long glass tube that is open at both ends is -placed in water, forces cause the water to rise in the tube to a -certain height. The finer the bore of the tube, the higher the -water rises. A tube with a hairlike bore is called a capillary -tube and the liquid rise in it is called capillarity. How could -you show that this rise is not due to atmospheric pressure? - Seemingly, water rises in capillary tubes because the adhesive -forces between glass and water molecules are greater than the cohesive -forces between water molecules. -#create para1 - We say that matter is anything which occupies space and has -weight. Matter possesses inertia, which is a resistance to change -of position or motion. It may be acted on by forces which may set -it in motion, or change its motion. While all these statements -are descriptive of matter, they do not provide us with a completely -satisfactory definition. Scientists, with their great knowledge -of the properties and behavior of matter, are not yet able to -define it precisely. Nature still holds many secrets to challenge -the minds of men. - The quantity of matter which a body possesses is known as its -mass. -#create para2 - When one end of a long glass tube that is open at both ends is -placed in water, forces cause the water to rise in the tube to a -certain height. The finer the bore of the tube, the higher the -water rises. A tube with a hairlike bore is called a capillary -tube and the liquid rise in it is called capillarity. How could -you show that this rise is not due to atmospheric pressure? - Seemingly, water rises in capillary tubes because the adhesive -forces between glass and water molecules are greater than the cohesive -forces between water molecules. -#user -#cmp both Ref -#log -#next -60.2b 5 diff --git a/usr.bin/learn/lib/editor/L60.2b b/usr.bin/learn/lib/editor/L60.2b deleted file mode 100644 index f98b9ea995c..00000000000 --- a/usr.bin/learn/lib/editor/L60.2b +++ /dev/null @@ -1,109 +0,0 @@ -#print -You can of course combine many files. Make a file -"total" which contains the pieces "first", "second", -"third", and "fourth" in that order. Then type "ready". -#create Ref - It has been already observed that the federal government -ought to possess the power of providing for the support -of the national forces; in which proposition was intended -to be included the expense of raising troops, of building -and equipping fleets, and all other expenses in any wise -connected with military arrangements and operations. But -these are not the only objects to which the jurisdiction of -the Union in respect to revenue must necessarily be empowered -to extend. It must embrace a provision for the -support of the national civil list; for the payment of the -national debts contracted, or that may be contracted; -and, in general, for all those matters which will call for -disbursements out of the national treasury. The conclusion -is that there must be interwoven in the frame of the -government a general power of taxation, in one shape or -another. - Money is, with propriety, considered as the vital principle -of the body politic; as that which sustains its life and -motion and enables it to perform its most essential functions. -A complete power, therefore, to procure a regular -and adequate supply of revenue, as far as the resources -of the community will permit, may be regarded -as an indispensable ingredient in every constitution. -From a deficiency in this particular, one of two evils -must ensue: either the people must be subjected to -continual plunder, as a substitute for a more eligible -mode of supplying the public wants, or the government -must sink into a fatal atrophy, and, in a short course of -time, perish. - In the Ottoman or Turkish empire the sovereign, -though in other respects absolute master of the lives and -fortunes of his subjects, has no right to impose a new tax. -The consequence is that he permits the bashaws or governors -of provinces to pillage the people at discretion, -and, in turn, squeezes out of them the sums of which he -stands in need to satisfy his own exigencies and those of -the state. In America, from a like cause, the government -of the Union has gradually dwindled into a state of decay, -approaching nearly to annihilation. Who can doubt that -the happiness of the people in both countries would be -promoted by competent authorities in the proper hands -to provide the revenues which the necessities of the public -might require? - The present Confederation, feeble as it is, intended to -repose in the United States an unlimited power of providing -for the pecuniary wants of the Union. But proceeding -upon an erroneous principle, it has been done in -such a manner as entirely to have frustrated the intention. -#create first - It has been already observed that the federal government -ought to possess the power of providing for the support -of the national forces; in which proposition was intended -to be included the expense of raising troops, of building -and equipping fleets, and all other expenses in any wise -connected with military arrangements and operations. But -these are not the only objects to which the jurisdiction of -the Union in respect to revenue must necessarily be empowered -to extend. It must embrace a provision for the -support of the national civil list; for the payment of the -national debts contracted, or that may be contracted; -and, in general, for all those matters which will call for -disbursements out of the national treasury. The conclusion -is that there must be interwoven in the frame of the -government a general power of taxation, in one shape or -another. -#create fourth - The present Confederation, feeble as it is, intended to -repose in the United States an unlimited power of providing -for the pecuniary wants of the Union. But proceeding -upon an erroneous principle, it has been done in -such a manner as entirely to have frustrated the intention. -#create second - Money is, with propriety, considered as the vital principle -of the body politic; as that which sustains its life and -motion and enables it to perform its most essential functions. -A complete power, therefore, to procure a regular -and adequate supply of revenue, as far as the resources -of the community will permit, may be regarded -as an indispensable ingredient in every constitution. -From a deficiency in this particular, one of two evils -must ensue: either the people must be subjected to -continual plunder, as a substitute for a more eligible -mode of supplying the public wants, or the government -must sink into a fatal atrophy, and, in a short course of -time, perish. -#create third - In the Ottoman or Turkish empire the sovereign, -though in other respects absolute master of the lives and -fortunes of his subjects, has no right to impose a new tax. -The consequence is that he permits the bashaws or governors -of provinces to pillage the people at discretion, -and, in turn, squeezes out of them the sums of which he -stands in need to satisfy his own exigencies and those of -the state. In America, from a like cause, the government -of the Union has gradually dwindled into a state of decay, -approaching nearly to annihilation. Who can doubt that -the happiness of the people in both countries would be -promoted by competent authorities in the proper hands -to provide the revenues which the necessities of the public -might require? -#user -#cmp total Ref -#next -60.2c 5 diff --git a/usr.bin/learn/lib/editor/L60.2c b/usr.bin/learn/lib/editor/L60.2c deleted file mode 100644 index b7a28e95748..00000000000 --- a/usr.bin/learn/lib/editor/L60.2c +++ /dev/null @@ -1,57 +0,0 @@ -#print -You can use an address on the 'r' command to read input at a particular -location in the file. Thus - 5r name -reads file "name" and appends its contents after line 5 o f the file. -You can use any kind of address, including a search. Here is a file "chem". -Find the line in file "chem" which contains the word "eight"; -read the file "more" and append it after that line. Then rewrite -"chem" and type "ready". -#create Ref - When elements combine to form compounds, the electrons in the -outermost shell of the atoms are the only ones that take part in the -reaction. These electrons are either transferred from the outer -shell of one atom to the outer shell of another, or, in some cases, -shared with the electrons in the outer shell of the second atom. - Whether the electrons are transferred to the second atom or shared, -this atom completes its quota of eight electrons in the outer shell. - An oxide is a compound containing oxygen and one other element. -The simplest of the oxides is H2O -- pure water, or hydrogen oxide. -Carbon dioxide is CO2 and is formed during the burning of organic -matter such as wood, paper, gasoline, or coal. In the same burning -process, H2O is formed and energy is released, generally as heat, -sometimes as light. Carbon dioxide is in the breath you just -exhaled. This gas is given off by decaying plant and animal matter. -Decay is a burning process. - Oxidation is a word that covers all the different ways things -burn. When something oxidizes, it is burning. - Compounds which are formed by the interchange of electrons are -called ionic compounds. The ions formed are said to possess -electrovalence. -#create chem - When elements combine to form compounds, the electrons in the -outermost shell of the atoms are the only ones that take part in the -reaction. These electrons are either transferred from the outer -shell of one atom to the outer shell of another, or, in some cases, -shared with the electrons in the outer shell of the second atom. - Whether the electrons are transferred to the second atom or shared, -this atom completes its quota of eight electrons in the outer shell. - Compounds which are formed by the interchange of electrons are -called ionic compounds. The ions formed are said to possess -electrovalence. -#create more - An oxide is a compound containing oxygen and one other element. -The simplest of the oxides is H2O -- pure water, or hydrogen oxide. -Carbon dioxide is CO2 and is formed during the burning of organic -matter such as wood, paper, gasoline, or coal. In the same burning -process, H2O is formed and energy is released, generally as heat, -sometimes as light. Carbon dioxide is in the breath you just -exhaled. This gas is given off by decaying plant and animal matter. -Decay is a burning process. - Oxidation is a word that covers all the different ways things -burn. When something oxidizes, it is burning. -#user -#cmp chem Ref -#log -#next -60.2d 5 diff --git a/usr.bin/learn/lib/editor/L60.2d b/usr.bin/learn/lib/editor/L60.2d deleted file mode 100644 index 8a178761c9c..00000000000 --- a/usr.bin/learn/lib/editor/L60.2d +++ /dev/null @@ -1,52 +0,0 @@ -#print -This is trickier. Read the file "text". Look for a line saying -"insert file ... here". Delete that line, and in its -place (after the preceding line) read in the file asked for. -Then rewrite "text" and type "ready". -#create Ref - The severity of the judicial and penal system was partly -caused by the defects of the police. Only a small proportion of -criminals were caught, and even when arrests were made, but little -evidence was collected. The officers, so far from being scientific -were not even properly professional. For although the constable of -each village and the watchman of each town were paid to guard peace -land property, they were yet neither specially fitted nor trained -for that employment. In a country village the case was even worse. -For there the magistrates could only afford to hire the part-service -of a farmer-constable. - It is a striking fact that until recently democracy never -flourished except in very small states -- for the most part in cities. -It is true that in both the Persian and the Roman empires a measure -of self-government was accorded to local communities, but only in -respect to purely local affairs; in no large state as a whole was -democratic government found to be practicable. One essential reason -is that until recently the means of communication were too slow and -uncertain to create the necessary solidarity of interest and similarity -of information over large areas. -#create inside -land property, they were yet neither specially fitted nor trained -for that employment. In a country village the case was even worse. -For there the magistrates could only afford to hire the part-service -of a farmer-constable. - It is a striking fact that until recently democracy never -flourished except in very small states -- for the most part in cities. -It is true that in both the Persian and the Roman empires a measure -of self-government was accorded to local communities, but only in -#create text - The severity of the judicial and penal system was partly -caused by the defects of the police. Only a small proportion of -criminals were caught, and even when arrests were made, but little -evidence was collected. The officers, so far from being scientific -were not even properly professional. For although the constable of -each village and the watchman of each town were paid to guard peace - *** insert file "inside" here *** -respect to purely local affairs; in no large state as a whole was -democratic government found to be practicable. One essential reason -is that until recently the means of communication were too slow and -uncertain to create the necessary solidarity of interest and similarity -of information over large areas. -#user -#cmp text Ref -#log -#next -61.1a 10 diff --git a/usr.bin/learn/lib/editor/L61.1a b/usr.bin/learn/lib/editor/L61.1a deleted file mode 100644 index 407be4366c0..00000000000 --- a/usr.bin/learn/lib/editor/L61.1a +++ /dev/null @@ -1,27 +0,0 @@ -#print -Note that usually you just type 'w' without a file name, -and the editor buffer is written on the 'current file'. -What is the 'current file' when you have executed an 'r' -command? Well, it doesn't change. But rather than -be in doubt, there is a command - f -which prints the current file name. -You can change the current file name with - f name -so that you can copy file 'old' to 'new' with - ed old - f new - w - q -Try that: copy file 'first' to 'second' in this -directory. Then type "ready". -#create first -This is the -file to be copied -using the 'f' command. -#user -#cmp first second -#log -#next -62.1a 10 -62.2a 5 diff --git a/usr.bin/learn/lib/editor/L62.1a b/usr.bin/learn/lib/editor/L62.1a deleted file mode 100644 index 4b8eb903793..00000000000 --- a/usr.bin/learn/lib/editor/L62.1a +++ /dev/null @@ -1,67 +0,0 @@ -#print -Frequently you will want to move one or more lines -from one place in a file to another. The command - -5,10m30 - -will pick up lines 5 through 10 and move them after line 30. -You can of course use context searches for addresses: - -/ab/,/cd/m/xx/ - -finds a line containing "ab", then one containing "cd", -and moves the section of the file they bracket after the -next line containing "xx". -Or you can use ".", "$", etc.: - -.,.+2m$ - -moves the three lines starting at "." to the end. - -There is a file "word" which -is out of order; re-arrange it to be alphabetical. -#create Ref -bands -becomes -course -dissolve -events -for -have -human -in -it -necessary -of -one -people -political -the -to -when -which -#create word -bands -becomes -course -in -it -necessary -of -one -people -political -dissolve -events -for -have -human -the -to -when -which -#user -#cmp word Ref -#log -#next -63.1a 10 diff --git a/usr.bin/learn/lib/editor/L62.2a b/usr.bin/learn/lib/editor/L62.2a deleted file mode 100644 index 553438a11d4..00000000000 --- a/usr.bin/learn/lib/editor/L62.2a +++ /dev/null @@ -1,59 +0,0 @@ -#print -A very useful command in the UNIX editor -is the 'm' command, which moves a lot of -lines from one place to another in a file. For example, - 5,10m20 -picks up lines 5 through 10 and moves them after line 20. Try -that on the file "list" in this directory: move lines 5 to 10 after -line 20, rewrite the file, and type "ready". -#create Ref - computer languages - -fortran -cobol -snobol -comit -lex -yacc -c -tmg -ratfor -basic -bon -bcpl -algol 60 -algol 68 -pl/i -pl/c -pl/360 -apl -altran -formac -#create list - computer languages - -fortran -cobol -algol 60 -algol 68 -pl/i -pl/c -pl/360 -apl -snobol -comit -lex -yacc -c -tmg -ratfor -basic -bon -bcpl -altran -formac -#user -#cmp list Ref -#log -#next -62.2b 5 diff --git a/usr.bin/learn/lib/editor/L62.2b b/usr.bin/learn/lib/editor/L62.2b deleted file mode 100644 index ebb674d1a79..00000000000 --- a/usr.bin/learn/lib/editor/L62.2b +++ /dev/null @@ -1,32 +0,0 @@ -#print - You can of course use any kind of addresses for the three addresses -in the 'm' command. Think of the command as - "from address-1 until address-2 gather up and MOVE to address-3". -OK. In the file "story" move the lines from the line -that contains "back" until the line containing "prevail" to the -end of the file. Then rewrite "story" and type "ready". -#create Ref - Only twice in the nation's history has daylight-savings time been -uniformly observed throughout the land -- during World War I, the first -DST was tried, and again during World War II. Immediately after -both wars, however, many areas abandoned DST altogether. - Last week the House voted 292 to 93 to require all states to move -their clocks ahead an hour on the last Sunday in April, and set them -back again on the last Sunday in October -- unless a state legislature -specifically votes to stay on standard time. In that case, local -options are out and standard time must prevail through the state. -#create story - Only twice in the nation's history has daylight-savings time been -uniformly observed throughout the land -- during World War I, the first -DST was tried, and again during World War II. Immediately after -both wars, however, many areas abandoned DST altogether. -back again on the last Sunday in October -- unless a state legislature -specifically votes to stay on standard time. In that case, local -options are out and standard time must prevail through the state. - Last week the House voted 292 to 93 to require all states to move -their clocks ahead an hour on the last Sunday in April, and set them -#user -#cmp story Ref -#log -#next -62.2c 5 diff --git a/usr.bin/learn/lib/editor/L62.2c b/usr.bin/learn/lib/editor/L62.2c deleted file mode 100644 index ecd799ffb7b..00000000000 --- a/usr.bin/learn/lib/editor/L62.2c +++ /dev/null @@ -1,49 +0,0 @@ -#print -In this directory is a file "word" which should be in alphabetical -order but is not; put it in order by picking up a block of lines -and relocating them. Then rewrite the file and type "ready". -#create Ref -bands -becomes -course -dissolve -events -for -have -human -in -it -necessary -of -one -people -political -the -to -when -which -#create word -bands -becomes -course -in -it -necessary -of -one -people -political -dissolve -events -for -have -human -the -to -when -which -#user -#cmp word Ref -#log -#next -63.1a 10 diff --git a/usr.bin/learn/lib/editor/L63.1a b/usr.bin/learn/lib/editor/L63.1a deleted file mode 100644 index a1f0acccd64..00000000000 --- a/usr.bin/learn/lib/editor/L63.1a +++ /dev/null @@ -1,43 +0,0 @@ -#print -Line 0 is a legitimate address for a few commands; -you can append text at the beginning of a file -by typing - 0a -and you can move lines to the beginning of a files -by using - m0 -Move the last three lines of file "tax" to the beginning, -then type "ready". -#create Ref -If you sustain an "overall foreign loss" -for any taxable year, -a recapture provision -will treat a part of -foreign income realized -in a later year -as income from -U. S. sources. - -These rules generally apply -to losses sustained in taxable -years beginning after -December 31, 1975. -#create tax -will treat a part of -foreign income realized -in a later year -as income from -U. S. sources. - -These rules generally apply -to losses sustained in taxable -years beginning after -December 31, 1975. -If you sustain an "overall foreign loss" -for any taxable year, -a recapture provision -#user -#cmp Ref tax -#log -#next -63.1b 10 diff --git a/usr.bin/learn/lib/editor/L63.1b b/usr.bin/learn/lib/editor/L63.1b deleted file mode 100644 index 9b92488612a..00000000000 --- a/usr.bin/learn/lib/editor/L63.1b +++ /dev/null @@ -1,13 +0,0 @@ -#print -What command will move the current line -to the beginning of the file? Type -"answer COMMAND", where COMMAND is the command. -#copyin -#user -#uncopyin -#match m0 -#match .m0 -"m0" is easier. -#log -#next -63.1c 10 diff --git a/usr.bin/learn/lib/editor/L63.1c b/usr.bin/learn/lib/editor/L63.1c deleted file mode 100644 index 0ef79dc2d20..00000000000 --- a/usr.bin/learn/lib/editor/L63.1c +++ /dev/null @@ -1,13 +0,0 @@ -#print -What command will move the current line -to the end of the file? Type -"answer COMMAND", where COMMAND is the command. -#copyin -#user -#uncopyin -#match m$ -#match .m$ -"m$" is easier. -#log -#next -63.1d 10 diff --git a/usr.bin/learn/lib/editor/L63.1d b/usr.bin/learn/lib/editor/L63.1d deleted file mode 100644 index 999926f9be0..00000000000 --- a/usr.bin/learn/lib/editor/L63.1d +++ /dev/null @@ -1,12 +0,0 @@ -#print -Will the command - m+ -interchange lines "." and ".+1"? -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -63.1e 10 diff --git a/usr.bin/learn/lib/editor/L63.1e b/usr.bin/learn/lib/editor/L63.1e deleted file mode 100644 index 623394728f2..00000000000 --- a/usr.bin/learn/lib/editor/L63.1e +++ /dev/null @@ -1,13 +0,0 @@ -#print -Will the command - m- -interchange lines "." and ".-1"? -Answer yes or no. -#copyin -#user -#uncopyin -#match no -You actually need "m--". -#log -#next -64.1a 10 diff --git a/usr.bin/learn/lib/editor/L64.1a b/usr.bin/learn/lib/editor/L64.1a deleted file mode 100644 index 93cf0451325..00000000000 --- a/usr.bin/learn/lib/editor/L64.1a +++ /dev/null @@ -1,34 +0,0 @@ -#print -Another command similar to 'm' is 't'; -the command - 5,8t15 -picks up lines 5 through 8 and makes a copy of them, -which it places after line 15. It differs from -'m' only in that the lines remain in their old place -as well as appearing in their new place. (Just like "cp" -and "mv" with files). In this directory is a file -"double". Using the editor, find the line containing -"-------" and make a copy of it at the -end of the file. -#create Ref ------------- -This file should be -bracketed by the -dashes but as it -is given to you -there are only dashes -at the top. ------------- -#create double ------------- -This file should be -bracketed by the -dashes but as it -is given to you -there are only dashes -at the top. -#user -#cmp double Ref -#log -#next -64.1b 10 diff --git a/usr.bin/learn/lib/editor/L64.1b b/usr.bin/learn/lib/editor/L64.1b deleted file mode 100644 index 3c66753a57b..00000000000 --- a/usr.bin/learn/lib/editor/L64.1b +++ /dev/null @@ -1,14 +0,0 @@ -#print -Another exercise in the effective use of the 't' -command: What command should be typed to make -a second copy of the current line? -Type "answer XX", where XX is the command. -#copyin -#user -#uncopyin -#match t. -#match .t. -You could just say "t.". -#log -#next -65.1a 10 diff --git a/usr.bin/learn/lib/editor/L65.1a b/usr.bin/learn/lib/editor/L65.1a deleted file mode 100644 index f51beaf84ee..00000000000 --- a/usr.bin/learn/lib/editor/L65.1a +++ /dev/null @@ -1,37 +0,0 @@ -#print -A strange, and not often important command, is the 'l' -(list) command. When it is needed, though, it is vital. -It is almost identical to 'p' (print) except that control -characters (like tab or backspace) are printed in a way -that lets you see what they are no matter what the terminal does. -From time to time strange characters will -sneak into your files; they won't show when you print -them, and yet they will confuse you. For example, -you might be unable to find a line by searching -for it with - /abc/ -and yet it would print as "abc" if there were -a funny character in the line between 'a' and 'b'. -Funny characters are generated by hitting the control -keys on the terminal; they print as '\' followed -by a number. -There is a file "weird" in this directory. Print -it both with "1,$p" and "1,$l" -and observe the difference. Then leave the editor. -Which word on the last line has a funny character in it? -Type "answer WORD" where WORD is that word (without the funny -symbol). -#create weird -This line has tabs in it. -So does this one. -Here is a line with____ backspaces of a useful sort. -These backspacesonlyconfuse matters. - -there's a strange character in this line even though it prints ok. -#copyin -#user -#uncopyin -#match this -#log -#next -66.1a 10 diff --git a/usr.bin/learn/lib/editor/L66.1a b/usr.bin/learn/lib/editor/L66.1a deleted file mode 100644 index 8ae60e5803d..00000000000 --- a/usr.bin/learn/lib/editor/L66.1a +++ /dev/null @@ -1,102 +0,0 @@ -#print -The file "memo" contains several paragraphs, -where a paragraph starts at any line that begins with -a blank. It is desired to remove those blanks at the beginning -of lines, and instead mark the paragraphs by inserting -a line containing only - -.PP - -before each paragraph. Change the file in that -way and then rewrite it; then type "ready". -#create Ref -The Ascent of the Riffelberg -by Mark Twain - -.PP -I sat silent some time, then turned to Harris and said: -``My mind is made up.'' -Something in my tone struck him; and when he glanced -at my eye and read what was written there, his face paled -perceptibly. He hesitated a moment, then said: -``Speak.'' -.PP -I answered, with perfect calmness: -``I WILL ASCEND THE RIFFELBERG.'' -.PP -If I had shot my poor friend he could not have fallen from -his chair more suddenly. If I had been his father he -could not have pleaded harder to get me to give up my -purpose. But I turned a deaf ear to all he said. When he -perceived at last that nothing could alter my determination, -he ceased to urge, and for a while the deep silence was broken only -by his sobs. I sat in marble resolution, with my -eyes fixed upon vacancy, for in spirit I was already -wrestling with the perils of the mountains, and my friend sat -gazing at me in adoring admiration through his tears. At -last he threw himself upon me in a loving embrace and -exclaimed in broken tones: -``Your Harris will never desert you. We will die together!'' -.PP -I cheered the noble fellow with praises, and soon his fears -were forgotten and he was eager for the adventure. He -wanted to summon the guides at once and leave at two in -the morning, as he supposed the custom was; but I explained that nobody -was looking at that hour; and that the start in the dark -was not usually made from the village but -from the first night's resting-place on the mountainside. I -said we would leave the village at 3 or 4 p.m. on the morrow; -meantime he could notify the guides, and also let the public -know of the attempt which we proposed to make. -.PP -I went to bed, but not to sleep. No man can sleep when -he is about to undertake one of these Alpine exploits. I -tossed feverishly all night long, and was glad enough when -I heard the clock strike half past eleven and knew it was -time to get up for dinner. -#create memo -The Ascent of the Riffelberg -by Mark Twain - - I sat silent some time, then turned to Harris and said: -``My mind is made up.'' -Something in my tone struck him; and when he glanced -at my eye and read what was written there, his face paled -perceptibly. He hesitated a moment, then said: -``Speak.'' - I answered, with perfect calmness: -``I WILL ASCEND THE RIFFELBERG.'' - If I had shot my poor friend he could not have fallen from -his chair more suddenly. If I had been his father he -could not have pleaded harder to get me to give up my -purpose. But I turned a deaf ear to all he said. When he -perceived at last that nothing could alter my determination, -he ceased to urge, and for a while the deep silence was broken only -by his sobs. I sat in marble resolution, with my -eyes fixed upon vacancy, for in spirit I was already -wrestling with the perils of the mountains, and my friend sat -gazing at me in adoring admiration through his tears. At -last he threw himself upon me in a loving embrace and -exclaimed in broken tones: -``Your Harris will never desert you. We will die together!'' - I cheered the noble fellow with praises, and soon his fears -were forgotten and he was eager for the adventure. He -wanted to summon the guides at once and leave at two in -the morning, as he supposed the custom was; but I explained that nobody -was looking at that hour; and that the start in the dark -was not usually made from the village but -from the first night's resting-place on the mountainside. I -said we would leave the village at 3 or 4 p.m. on the morrow; -meantime he could notify the guides, and also let the public -know of the attempt which we proposed to make. - I went to bed, but not to sleep. No man can sleep when -he is about to undertake one of these Alpine exploits. I -tossed feverishly all night long, and was glad enough when -I heard the clock strike half past eleven and knew it was -time to get up for dinner. -#user -#cmp memo Ref -#log -#next -70.1a 10 -70.2a 5 diff --git a/usr.bin/learn/lib/editor/L7.1a b/usr.bin/learn/lib/editor/L7.1a deleted file mode 100644 index 379e1da89b5..00000000000 --- a/usr.bin/learn/lib/editor/L7.1a +++ /dev/null @@ -1,37 +0,0 @@ -#print -Although specifying lines by line number is -easy to understand, it is hard to do in a long -file. You will therefore want to learn other -ways of addressing lines. The 'current line' -is addressed with the symbol - . -so that it can be printed, for example with - .p -just as you could print a line by "3p". -Try that in this file; the current line is -set to the last line of the current file. -Try ".p"; then "w", "q", and "ready" as usual. -Here's the full file - - -#create Ref -john quincy adams -91 -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#print file -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -2 .ocopy >X1 -#cmp X1 Ref -#log -#next -7.1b 10 diff --git a/usr.bin/learn/lib/editor/L7.1b b/usr.bin/learn/lib/editor/L7.1b deleted file mode 100644 index 84e229e2e1d..00000000000 --- a/usr.bin/learn/lib/editor/L7.1b +++ /dev/null @@ -1,41 +0,0 @@ -#print -As I said, '.' is set to the last line touched -by any command in the editor. So if you type - 3p -. will be set to line 3; and then - .p -will print the same line. -Try that - -with the usual trailer, the commands should be - -3p -.p -w -q -ready -The file is the same as before. -#create Ref -3p -.p -w -q -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#pipe -#copyin -ed file -#user -#uncopyin -#unpipe -tail -4 .copy >X1 -#cmp X1 Ref -#log -#next -8.1a 10 -8.2a 6 -7.2c 2 diff --git a/usr.bin/learn/lib/editor/L7.2c b/usr.bin/learn/lib/editor/L7.2c deleted file mode 100644 index 81aeabcde0a..00000000000 --- a/usr.bin/learn/lib/editor/L7.2c +++ /dev/null @@ -1,29 +0,0 @@ -#print -Now, print the fourth line in this file twice, -using the same pattern. The file is the same, -and you should put the usual finish (w, q, ready) -after printing the line. -#create Ref -4p -.p -w -q -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#pipe -#copyin -ed file -#user -#uncopyin -#unpipe -tail -4 .copy >X1 -#cmp X1 Ref -#log -#next -8.1a 10 -8.2a 5 diff --git a/usr.bin/learn/lib/editor/L70.1a b/usr.bin/learn/lib/editor/L70.1a deleted file mode 100644 index 01049894b87..00000000000 --- a/usr.bin/learn/lib/editor/L70.1a +++ /dev/null @@ -1,49 +0,0 @@ -#print -Perhaps the most powerful command in the editor is the 'g' -(global) command. This always precedes a second command -on the same command line; it selects those file lines -on which the second command is to be executed. -For example - g/abc/s/def/ghi/p -says: "Find all lines in the file which -contain the string "abc"; change the first -"def" on any such line into "ghi". The command -after the 'g' may be any command, of course. -Needless to say, the expressions after the 'g' may -include all the special characters. -Edit the file "towns" so that each line beginning -with "-" has " (county seat)" added at its end. -Rewrite the file and type "ready". -#create Ref --newark (county seat) - east orange - south orange - maplewood --elizabeth (county seat) - linden - cranford - westfield --morristown (county seat) - madison - chatham - dover -#create towns --newark - east orange - south orange - maplewood --elizabeth - linden - cranford - westfield --morristown - madison - chatham - dover -#user -#cmp towns Ref -#log -#next -71.1a 10 -70.2e 9 -70.2d 6 diff --git a/usr.bin/learn/lib/editor/L70.2a b/usr.bin/learn/lib/editor/L70.2a deleted file mode 100644 index afb862befe1..00000000000 --- a/usr.bin/learn/lib/editor/L70.2a +++ /dev/null @@ -1,30 +0,0 @@ -#print -Perhaps the most powerful editor command is the 'g' -(global) command. This command selects sets of lines -on which other commands are executed. For example, - g/abc/p -prints all lines on which 'abc' appears. In this directory -is a file "story". Print all lines on which the word -"of" appears. Then leave the editor and type "ready". -#create Ref - The people of the United States are in a sense becoming a nation -of the United States in the future, it will be because that system -did too good a job of filling many of the needs of the people. -#create story - The people of the United States are in a sense becoming a nation -on a tiger. They must learn to consume more and more or, they are -warned, their magnificent economic machine may turn and devour them. -They must be induced to step up their individual consumption higher -and higher, whether they have any pressing need for the goods or -not. Their ever-expanding economy demands it. - If modifications are forced upon the private-enterprise system -of the United States in the future, it will be because that system -did too good a job of filling many of the needs of the people. -#copyout -#user -#uncopyout -grep of .ocopy >x1 -#cmp x1 Ref -#log -#next -70.2b 5 diff --git a/usr.bin/learn/lib/editor/L70.2b b/usr.bin/learn/lib/editor/L70.2b deleted file mode 100644 index b302fcfef17..00000000000 --- a/usr.bin/learn/lib/editor/L70.2b +++ /dev/null @@ -1,84 +0,0 @@ -#print -You can use any command with 'g', not just 'p'. For example - g/xx/s/a/b/ -changes 'a' to 'b' on every line containing 'xx'. As an -example of the global command used with 'd', try this: -In file "cities" there is a list of cities with their states and -zip codes. Delete all cities which are in New Jersey (i.e. all -lines containing NJ). Then rewrite the file and type "ready". -#create Ref -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#create cities -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NJ 08101 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Elizabeth NJ 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NJ 07303 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NJ 07101 -Paterson NJ 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#user -#cmp cities Ref -#log -#next -70.2c 5 -70.2d 10 diff --git a/usr.bin/learn/lib/editor/L70.2c b/usr.bin/learn/lib/editor/L70.2c deleted file mode 100644 index cf3ce547307..00000000000 --- a/usr.bin/learn/lib/editor/L70.2c +++ /dev/null @@ -1,84 +0,0 @@ -#print -In this directory is another copy of the -"cities" file as you modified it, -and the previous version named "ocities". -Use "diff" to find out how many lines you deleted. -Reply "answer N" where N is the number of -lines you removed from "cities". -#create cities -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#create ocities -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NJ 08101 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Elizabeth NJ 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NJ 07303 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NJ 07101 -Paterson NJ 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#copyin -#user -#uncopyin -#match 6 -#log -#next -70.2d 10 diff --git a/usr.bin/learn/lib/editor/L70.2d b/usr.bin/learn/lib/editor/L70.2d deleted file mode 100644 index beb4bd0d7fd..00000000000 --- a/usr.bin/learn/lib/editor/L70.2d +++ /dev/null @@ -1,92 +0,0 @@ -#print -There is another file of cities with ZIP codes and states -in this directory, but it was typed in wrong. Some cities -in New Jersey are labeled as being in New York. However the -ZIP codes are right. Since the cities in New Jersey are -exactly those with zip codes beginning 07, if you -can execute the substitute command to change NY to NJ on all -lines with " 07" in them, all will be well. -Don't forget the blank before the 07 - some ZIP -codes have "07" in the middle, remember. -Change file "cities" and rewrite it. Then type "ready". -#create Ref -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NJ 08101 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Elizabeth NJ 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NJ 07303 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NJ 07101 -Paterson NJ 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#create cities -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NJ 08101 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Elizabeth NY 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NY 07303 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NY 07101 -Paterson NY 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#user -#cmp cities Ref -#log -#next -70.2e 5 diff --git a/usr.bin/learn/lib/editor/L70.2e b/usr.bin/learn/lib/editor/L70.2e deleted file mode 100644 index ffc1bcdcfb8..00000000000 --- a/usr.bin/learn/lib/editor/L70.2e +++ /dev/null @@ -1,95 +0,0 @@ -#print -There is a file "cities" in this directory in which each line -contains a city, state and ZIP code. But it was typed -in by a member of management and is really botched - every -NJ city is labeled as being in NY. But the Zip codes are right - -if you can change NY to NJ on each line containing a ZIP code -beginning with either 07 or 08 all will be fixed up. Each line -looks like - St. Louis MO 63166 -and (1) remember the [] operators? and (2) don't forget -that digits appear in the middle of ZIP codes. -You may want to check what you're doing by writing the current -version on a different file name and using "diff" to check -on the changes. -#create Ref -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NJ 08101 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Elizabeth NJ 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NJ 07303 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NJ 07101 -Paterson NJ 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#create cities -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NY 08101 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Elizabeth NY 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NY 07303 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NY 07101 -Paterson NY 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#user -#cmp cities Ref -#log -#next -70.2f 5 diff --git a/usr.bin/learn/lib/editor/L70.2f b/usr.bin/learn/lib/editor/L70.2f deleted file mode 100644 index b5aa2ebdd7a..00000000000 --- a/usr.bin/learn/lib/editor/L70.2f +++ /dev/null @@ -1,90 +0,0 @@ -#print -Remember the search for blank lines with nothing on them? /^$/. -Pick up the file "table" and delete all blank lines; then rewrite -it and type "ready". -#create Ref -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NJ 08101 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Elizabeth NJ 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NJ 07303 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NJ 07101 -Paterson NJ 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#create table -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NJ 08101 -Chicago IL 60607 - -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 - -Elizabeth NJ 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NJ 07303 -Los Angeles CA 90053 -Miami FL 33101 - -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NJ 07101 -Paterson NJ 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 - - -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#user -#cmp table Ref -#log -#next -70.2g 5 diff --git a/usr.bin/learn/lib/editor/L70.2g b/usr.bin/learn/lib/editor/L70.2g deleted file mode 100644 index 3f34982f1df..00000000000 --- a/usr.bin/learn/lib/editor/L70.2g +++ /dev/null @@ -1,36 +0,0 @@ -#print -Here is a file "values". Whenever the word -"liter" appears in it, add at the end of that -line the characters - (1 liter = 1.06 quart) -The parentheses should appear in the final -file, and there should be one space before the -left parenthesis. When done, rewrite -the file and type "ready". -#create Ref -gasoline: .52/gallon -milk: 35/qt -rice: .30/lb -acetic acid: 1.20/liter (1 liter = 1.06 quart) -apples: .35/lb -cider: .55/liter (1 liter = 1.06 quart) -butter: .79/lb -soda: .42/liter (1 liter = 1.06 quart) -eggs: .89/doz -cream: 1.25/liter (1 liter = 1.06 quart) -#create values -gasoline: .52/gallon -milk: 35/qt -rice: .30/lb -acetic acid: 1.20/liter -apples: .35/lb -cider: .55/liter -butter: .79/lb -soda: .42/liter -eggs: .89/doz -cream: 1.25/liter -#user -#cmp values Ref -#log -#next -71.1a 5 diff --git a/usr.bin/learn/lib/editor/L71.1a b/usr.bin/learn/lib/editor/L71.1a deleted file mode 100644 index 1f665f31a01..00000000000 --- a/usr.bin/learn/lib/editor/L71.1a +++ /dev/null @@ -1,108 +0,0 @@ -#print -After the global command has selected the lines -to which the second command is to be applied, it sets '.' (the -current line) to each of these lines in turn as it executes -the controlled command. Thus you can reference the line -before or after the selected line. For example, - g/xx/.-1s/ab/cd/ -changes 'ab' to 'cd' on the line BEFORE each line with xx. -And - g/xx/$t.+1 -inserts a copy of the last line in the file two lines -after each line with 'xx' on it. -In this directory, the file 'memo' has paragraphs indicated -by lines beginning ".PP". Add two blanks to the beginning of -the line after each ".PP", and then delete the ".PP" lines. -This should take only two commands. Rewrite the file and then -type "ready". -#create Ref -The Ascent of the Riffelberg -by Mark Twain - - I sat silent some time, then turned to Harris and said: -``My mind is made up.'' -Something in my tone struck him; and when he glanced -at my eye and read what was written there, his face paled -perceptibly. He hesitated a moment, then said: -``Speak.'' - I answered, with perfect calmness: -``I WILL ASCEND THE RIFFELBERG.'' - If I had shot my poor friend he could not have fallen from -his chair more suddenly. If I had been his father he -could not have pleaded harder to get me to give up my -purpose. But I turned a deaf ear to all he said. When he -perceived at last that nothing could alter my determination, -he ceased to urge, and for a while the deep silence was broken only -by his sobs. I sat in marble resolution, with my -eyes fixed upon vacancy, for in spirit I was already -wrestling with the perils of the mountains, and my friend sat -gazing at me in adoring admiration through his tears. At -last he threw himself upon me in a loving embrace and -exclaimed in broken tones: -``Your Harris will never desert you. We will die together!'' - I cheered the noble fellow with praises, and soon his fears -were forgotten and he was eager for the adventure. He -wanted to summon the guides at once and leave at two in -the morning, as he supposed the custom was; but I explained that nobody -was looking at that hour; and that the start in the dark -was not usually made from the village but -from the first night's resting-place on the mountainside. I -said we would leave the village at 3 or 4 p.m. on the morrow; -meantime he could notify the guides, and also let the public -know of the attempt which we proposed to make. - I went to bed, but not to sleep. No man can sleep when -he is about to undertake one of these Alpine exploits. I -tossed feverishly all night long, and was glad enough when -I heard the clock strike half past eleven and knew it was -time to get up for dinner. -#create memo -The Ascent of the Riffelberg -by Mark Twain - -.PP -I sat silent some time, then turned to Harris and said: -``My mind is made up.'' -Something in my tone struck him; and when he glanced -at my eye and read what was written there, his face paled -perceptibly. He hesitated a moment, then said: -``Speak.'' -.PP -I answered, with perfect calmness: -``I WILL ASCEND THE RIFFELBERG.'' -.PP -If I had shot my poor friend he could not have fallen from -his chair more suddenly. If I had been his father he -could not have pleaded harder to get me to give up my -purpose. But I turned a deaf ear to all he said. When he -perceived at last that nothing could alter my determination, -he ceased to urge, and for a while the deep silence was broken only -by his sobs. I sat in marble resolution, with my -eyes fixed upon vacancy, for in spirit I was already -wrestling with the perils of the mountains, and my friend sat -gazing at me in adoring admiration through his tears. At -last he threw himself upon me in a loving embrace and -exclaimed in broken tones: -``Your Harris will never desert you. We will die together!'' -.PP -I cheered the noble fellow with praises, and soon his fears -were forgotten and he was eager for the adventure. He -wanted to summon the guides at once and leave at two in -the morning, as he supposed the custom was; but I explained that nobody -was looking at that hour; and that the start in the dark -was not usually made from the village but -from the first night's resting-place on the mountainside. I -said we would leave the village at 3 or 4 p.m. on the morrow; -meantime he could notify the guides, and also let the public -know of the attempt which we proposed to make. -.PP -I went to bed, but not to sleep. No man can sleep when -he is about to undertake one of these Alpine exploits. I -tossed feverishly all night long, and was glad enough when -I heard the clock strike half past eleven and knew it was -time to get up for dinner. -#user -#cmp memo Ref -#log -#next -72.1a 10 -72.2a 5 diff --git a/usr.bin/learn/lib/editor/L72.1a b/usr.bin/learn/lib/editor/L72.1a deleted file mode 100644 index c1fb0392165..00000000000 --- a/usr.bin/learn/lib/editor/L72.1a +++ /dev/null @@ -1,48 +0,0 @@ -#print -A command related to the global command is the 'v' command. -It also selects lines on which a second command is executed; the -difference between 'g' and 'v' is that the selected lines -for the 'v' command are all those on which the expression -is NOT found. Thus - v/abc/s/x/y/g -changes 'x' to 'y' on all lines NOT containing an 'abc'. -There is a file 'price' in this directory. Find all lines -that do NOT begin with blank and prefix three asterisks -to them. Then rewrite the file and type "ready". -#create Ref -***beef - shoulder 1.39/lb - flank 1.59/lb - sirloin 2.19/lb - round 1.89/lb -***fish - sword 3.99/lb - cod 1.99/lb - blues 2.49/lb - stripers 3.49/lb - flounder 2.99/lb -***pork - shoulder .89/lb - loin 1.59/lb - bacon 1.19/lb -#create price -beef - shoulder 1.39/lb - flank 1.59/lb - sirloin 2.19/lb - round 1.89/lb -fish - sword 3.99/lb - cod 1.99/lb - blues 2.49/lb - stripers 3.49/lb - flounder 2.99/lb -pork - shoulder .89/lb - loin 1.59/lb - bacon 1.19/lb -#user -#cmp price Ref -#log -#next -73.1a 10 diff --git a/usr.bin/learn/lib/editor/L72.2a b/usr.bin/learn/lib/editor/L72.2a deleted file mode 100644 index d286e316d7a..00000000000 --- a/usr.bin/learn/lib/editor/L72.2a +++ /dev/null @@ -1,33 +0,0 @@ -#print -A command related to the 'g' command is the 'v' command. The -'v' command also selects lines on which another command is to -be executed; the difference between 'g' and 'v' is that -the 'v' command selects all lines on which the specified -expression is NOT found. Thus - v/ly$/p -prints all lines which do NOT end in "ly". -Or - v/e/p -prints all lines WITHOUT an 'e'in them. -Are there any lines in file "story" -without an 'i'? Find out using the editor; then -leave the editor and type "yes" or "no". -#create story - Credit "rationing," already being imposed by major banks in -big cities, may soon spread to banks large and small in every corner -of the United States. Result: Speculative loans may become hard -to get anywhere. - Working in near-secrecy, a committee of the powerful American -Bankers Association is drafting an unprecedented policy statement -aimed at getting bankers across the country to be far choosier in -making business loans. The ABA it is believed, is being driven to -this move partly by a nagging fear that the Federal Government will -impose lending guidelines if banks fail to tighten up voluntarily. - The ABA's task is delicate. -#copyin -#user -#uncopyin -#match yes -#log -#next -72.2b 10 diff --git a/usr.bin/learn/lib/editor/L72.2b b/usr.bin/learn/lib/editor/L72.2b deleted file mode 100644 index b6a9d192b5d..00000000000 --- a/usr.bin/learn/lib/editor/L72.2b +++ /dev/null @@ -1,54 +0,0 @@ -#print -Edit the file "cities" to remove all lines NOT -containing "NJ". Then rewrite the file -and type "ready". -#create Ref -Camden NJ 08101 -Elizabeth NJ 07207 -Jersey City NJ 07303 -Newark NJ 07101 -Paterson NJ 07510 -Trenton NJ 08608 -#create cities -Albany NY 12201 -Atlanta GA 30301 -Baltimore MD 21233 -Boston MA 02109 -Bridgeport CN 06601 -Buffalo NY 14240 -Camden NJ 08101 -Chicago IL 60607 -Dallas TX 75221 -Denver CO 80201 -Detroit MI 48226 -Elizabeth NJ 07207 -Hartford CN 06101 -Houston TX 77052 -Indianapolis IN 46204 -Jersey City NJ 07303 -Los Angeles CA 90053 -Miami FL 33101 -Milwaukee WI 53201 -Minneapolis MN 55401 -New York NY 10001 -Newark NJ 07101 -Paterson NJ 07510 -Philadelphia PA 19104 -Phoenix AR 85026 -Pittsburgh PA 15230 -Providence RI 02904 -Rochester NY 14603 -San Diego CA 92101 -San Francisco CA 94101 -Seattle WA 98101 -St. Louis MO 63166 -Syracuse NY 13201 -Trenton NJ 08608 -Utica NY 13503 -Washington DC 20013 -Yonkers NY 10598 -#user -#cmp cities Ref -#log -#next -72.2c 10 diff --git a/usr.bin/learn/lib/editor/L72.2c b/usr.bin/learn/lib/editor/L72.2c deleted file mode 100644 index 4218185bc7d..00000000000 --- a/usr.bin/learn/lib/editor/L72.2c +++ /dev/null @@ -1,42 +0,0 @@ -#print -There is a file "price" in this directory. Find all -lines which don't begin with blank and put three asterisks -at the beginning of each such line. Then rewrite -the file and type "ready". -#create Ref -***beef - shoulder 1.39/lb - flank 1.59/lb - sirloin 2.19/lb - round 1.89/lb -***fish - sword 3.99/lb - cod 1.99/lb - blues 2.49/lb - stripers 3.49/lb - flounder 2.99/lb -***pork - shoulder .89/lb - loin 1.59/lb - bacon 1.19/lb -#create price -beef - shoulder 1.39/lb - flank 1.59/lb - sirloin 2.19/lb - round 1.89/lb -fish - sword 3.99/lb - cod 1.99/lb - blues 2.49/lb - stripers 3.49/lb - flounder 2.99/lb -pork - shoulder .89/lb - loin 1.59/lb - bacon 1.19/lb -#user -#cmp price Ref -#log -#next -72.2d 10 diff --git a/usr.bin/learn/lib/editor/L72.2d b/usr.bin/learn/lib/editor/L72.2d deleted file mode 100644 index 6f6fd89be10..00000000000 --- a/usr.bin/learn/lib/editor/L72.2d +++ /dev/null @@ -1,27 +0,0 @@ -#print -There is a file "song" in this directory. Find all lines -which don't end in "." and put a comma at the end of -these lines. Then rewrite the file and type "ready". -#create Ref -It seems that Early English art, - Alone retains its zest. -To charm and please its devotees, - We've done our level best. -We're not quite sure that all we do, - Has the Early English ring, -But as far as we can tell, - It's something lIke this sort of thing. -#create song -It seems that Early English art - Alone retains its zest. -To charm and please its devotees - We've done our level best. -We're not quite sure that all we do - Has the Early English ring -But as far as we can tell - It's something lIke this sort of thing. -#user -#cmp song Ref -#log -#next -73.1a 10 diff --git a/usr.bin/learn/lib/editor/L73.1a b/usr.bin/learn/lib/editor/L73.1a deleted file mode 100644 index 158d0d987b3..00000000000 --- a/usr.bin/learn/lib/editor/L73.1a +++ /dev/null @@ -1,34 +0,0 @@ -#print -Back early in this sequence we made clear that -the shell (the normal command interpreter) and the -editor were distinct and they didn't pay any attention -to each other's commands. -Sometimes you are in the editor and you really want -to execute a shell command. You can do that -by prefixing it with !. For example, - !ls -will list your directory. -Remember that "date" is the shell command -to find out what time it is. -Try editing the file 'bridge'; print it out, -then, without leaving the editor, ask for the -time and then leave the editor and say "ready". -#create bridge -brooklyn -manhattan -williamsburg -queensborough -george washington -triborough -bronx whitestone -throgs neck -#create X2 -!date -#copyin -#user -#uncopyin -grep date .copy | tail -1 >X1 -#cmp X1 X2 -#log -#next -74.1a 10 diff --git a/usr.bin/learn/lib/editor/L74.1a b/usr.bin/learn/lib/editor/L74.1a deleted file mode 100644 index 08be154718b..00000000000 --- a/usr.bin/learn/lib/editor/L74.1a +++ /dev/null @@ -1,80 +0,0 @@ -#print -Here's a last review exercise. In the file "cities" is a list -of cities with populations and Zip codes. The following cities -were omitted: add them in alphabetical order - St. Louis 622,236 MO 63166 - Columbus 539,677 OH 43216 -Then, edit the file so that - (a) the blanks, if any, at the beginnings of lines and -ends of lines are removed. - (b) each interior string of blanks is replaced by a single tab, -except for the blanks within "Los Angeles", "New Orleans", -"New York", "San Antonio", "San Diego", "San Francisco", -and "St. Louis". - (c) Spell "Washington" and "Indianapolis" correctly. -Then rewrite the file and type "ready". -#create Ref -Atlanta 496,973 GA 30301 -Baltimore 905,759 MD 21233 -Boston 641,071 MA 02109 -Bridgeport 156,542 CN 06601 -Buffalo 462,768 NY 14240 -Chicago 3,366,957 IL 60607 -Cleveland 750,903 OH 44101 -Columbus 539,677 OH 43216 -Dallas 844,401 TX 75221 -Denver 514,678 CO 80201 -Detroit 1,511,482 MI 48226 -Hartford 158,017 CN 06101 -Houston 1,232,802 TX 77052 -Indianapolis 774,624 IN 46201 -Los Angeles 2,809,596 CA 92101 -Miami 334,859 FL 33101 -Milwaukee 717,099 WI 53201 -Minneapolis 434,400 MN 55401 -New Orleans 593,471 LA 70140 -New York 7,894,862 NY 10001 -Newark 382,417 NJ 07901 -Omaha 347,328 NE 68108 -Philadephia 1,948,609 PA 19104 -Phoenix 581,562 AR 85026 -Pittsburgh 520,117 PA 15230 -San Antonio 654,153 TX 78205 -San Diego 696,769 CA 92101 -San Francisco 715,674 CA 94101 -Seattle 530,831 WA 98101 -St. Louis 622,236 MO 63166 -Washington 756,510 DC 20013 -#create cities - Atlanta 496,973 GA 30301 - Baltimore 905,759 MD 21233 -Boston 641,071 MA 02109 -Bridgeport 156,542 CN 06601 - Buffalo 462,768 NY 14240 - Chicago 3,366,957 IL 60607 -Cleveland 750,903 OH 44101 -Dallas 844,401 TX 75221 -Denver 514,678 CO 80201 -Detroit 1,511,482 MI 48226 -Hartford 158,017 CN 06101 -Houston 1,232,802 TX 77052 -Indianpolis 774,624 IN 46201 -Los Angeles 2,809,596 CA 92101 -Miami 334,859 FL 33101 - Milwaukee 717,099 WI 53201 -Minneapolis 434,400 MN 55401 -New Orleans 593,471 LA 70140 -New York 7,894,862 NY 10001 -Newark 382,417 NJ 07901 - Omaha 347,328 NE 68108 - Philadephia 1,948,609 PA 19104 -Phoenix 581,562 AR 85026 -Pittsburgh 520,117 PA 15230 - San Antonio 654,153 TX 78205 - San Diego 696,769 CA 92101 - San Francisco 715,674 CA 94101 - Seattle 530,831 WA 98101 -Washinggton 756,510 DC 20013 -#user -#cmp cities Ref -#log diff --git a/usr.bin/learn/lib/editor/L8.1a b/usr.bin/learn/lib/editor/L8.1a deleted file mode 100644 index ee421a44774..00000000000 --- a/usr.bin/learn/lib/editor/L8.1a +++ /dev/null @@ -1,38 +0,0 @@ -#print -To move around, you can use simple arithmetic -when specifying what to print. For example, - 3+1p -is the same as - 4p -as an editor command. Now that's not very interesting; -but if the '.' current line pointer is line 3, -then using - .+1p -instead of 4p is helpful. -For example, print the 3rd and 4th -lines of the familiar file using first "3p" to -get to line 3 and then ".+1p" to print the next line. -End as usual with w, q, and ready. -#create Ref -thomas jefferson -james madison -91 -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -3 .ocopy >X1 -#cmp Ref X1 -#log -#next -9.1a 10 -8.1b 7 diff --git a/usr.bin/learn/lib/editor/L8.1b b/usr.bin/learn/lib/editor/L8.1b deleted file mode 100644 index 852bc4f95b9..00000000000 --- a/usr.bin/learn/lib/editor/L8.1b +++ /dev/null @@ -1,18 +0,0 @@ -#print -You can also use "-" in addresses. For example, -the line before the current line is line ".-1" -and can be printed with ".-1p" or even just ".-1". -How would you print the line two lines before the current -line? Type "answer COMMAND" where COMMAND is -the command you would type to print that line. -#copyin -#user -#uncopyin -#match .-2p -#match .-2 -#match -2 -#match -- -#log -#next -9.1a 10 -9.2a 5 diff --git a/usr.bin/learn/lib/editor/L8.2a b/usr.bin/learn/lib/editor/L8.2a deleted file mode 100644 index 631b6f66d57..00000000000 --- a/usr.bin/learn/lib/editor/L8.2a +++ /dev/null @@ -1,44 +0,0 @@ -#print -You can give addresses involving simple arithmetic -to move around in the file. For example, - 3+1p -is the same as - 4p -in the editor. Now that's not interesting, but -if the current line (".") is line 3, then - .+1p -is also 4p; it prints the next line. For example, -you can print the 3rd and 4th lines of this file -using - 3p - .+1p - w - q -where "3p" prints the third line, as usual, -and then ".+1p" prints the next or fourth line. -Try that. Type "ready" when done. -#create Ref -caslon -century schoolbook -86 -#create file -baskerville -bodoni -caslon -century schoolbook -futura -helvetica -news gothic -times roman -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -3 .ocopy >X1 -#cmp Ref X1 -#log -#next -8.2b 5 -9.1a 10 diff --git a/usr.bin/learn/lib/editor/L8.2b b/usr.bin/learn/lib/editor/L8.2b deleted file mode 100644 index f7aeef5a7ee..00000000000 --- a/usr.bin/learn/lib/editor/L8.2b +++ /dev/null @@ -1,26 +0,0 @@ -#print -Using the same scheme, print lines 2 and 3 of this file. -Then rewrite it and leave and type "ready". -#create Ref -john adams -thomas jefferson -91 -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -3 .ocopy >X1 -#cmp Ref X1 -#log -#next -8.2c 3 -8.1b 8 diff --git a/usr.bin/learn/lib/editor/L8.2c b/usr.bin/learn/lib/editor/L8.2c deleted file mode 100644 index bd33aac34d7..00000000000 --- a/usr.bin/learn/lib/editor/L8.2c +++ /dev/null @@ -1,36 +0,0 @@ -#print -You can also use "-" in addresses. -For example, you can print the -line before the current line with - .-1p -as a command. Again, I'll put -you in the editor; print the fifth -line and then the fourth, using this -command to print lines in reverse -order. Then leave with w, q, and ready. -#create Ref -carrots -squash -83 -#create file -broccoli -mushrooms -cauliflower -squash -carrots -lettuce -string beans -peas -lima beans -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -3 .ocopy >X1 -#cmp Ref X1 -#log -#next -9.1a 10 -9.2a 5 diff --git a/usr.bin/learn/lib/editor/L9.1a b/usr.bin/learn/lib/editor/L9.1a deleted file mode 100644 index 7d5a1e7d061..00000000000 --- a/usr.bin/learn/lib/editor/L9.1a +++ /dev/null @@ -1,34 +0,0 @@ -#print -Printing only one line at a time gets pretty -slow. You can print several lines with -commands like - 1,3p -which prints lines 1, 2 and 3. -Again, I'll put you into the editor -with the familiar file. Print lines -2 through 5 of it; then type w, q and ready. -#create Ref -john adams -thomas jefferson -james madison -james monroe -91 -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -5 .ocopy >X1 -#cmp X1 Ref -#log -#next -10.1a 10 -9.2e 5 diff --git a/usr.bin/learn/lib/editor/L9.2a b/usr.bin/learn/lib/editor/L9.2a deleted file mode 100644 index 2ccb8daa373..00000000000 --- a/usr.bin/learn/lib/editor/L9.2a +++ /dev/null @@ -1,36 +0,0 @@ -#print -You can print several lines at once by -using commands like - 1,3p -which prints lines 1, 2 and 3. Again, -I'll put you into the editor. Print -lines 1 to 3 of the file; then type -w, q and ready. -Your commands should look like - 1,3p - w - q - ready -#create Ref -george washington -john adams -thomas jefferson -91 -#create file -george washington -john adams -thomas jefferson -james madison -james monroe -john quincy adams -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -4 .ocopy >X1 -#cmp X1 Ref -#log -#next -9.2b 5 diff --git a/usr.bin/learn/lib/editor/L9.2b b/usr.bin/learn/lib/editor/L9.2b deleted file mode 100644 index 3f9aca81d5a..00000000000 --- a/usr.bin/learn/lib/editor/L9.2b +++ /dev/null @@ -1,34 +0,0 @@ -#print -You can of course use any kind of line -numbers for the addresses in the -"p" command. Just as you did before, -print lines 2 through 5 of this file, -and then type w, q, and ready. -#create Ref -mushrooms -cauliflower -squash -carrots -83 -#create file -broccoli -mushrooms -cauliflower -squash -carrots -lettuce -string beans -peas -lima beans -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -tail -5 .ocopy >X1 -#cmp X1 Ref -#log -#next -9.3c 3 -9.2d 7 diff --git a/usr.bin/learn/lib/editor/L9.2d b/usr.bin/learn/lib/editor/L9.2d deleted file mode 100644 index ed4e4081322..00000000000 --- a/usr.bin/learn/lib/editor/L9.2d +++ /dev/null @@ -1,36 +0,0 @@ -#print -The "." operator can be used with multiple -addresses to refer to the current line -in either the first or second position (or both). -For example, you could print from the current line -to the 6th line with - .,6p -and similarly for any other line. I'll put -you in the editor again, with the current line -set in the middle of a short file; print from -the current line position to the fifth line, and -then type w, q and ready. -#create Ref - 2. UNIX - 3. hardware - 4. software - 5. manuals -97 -#create file - 2. UNIX - 3. hardware - 4. software - 5. manuals -you shouldn't have printed this line. -#copyout -#pipe -ed file -1t1 -#user -#unpipe -#uncopyout -tail -5 .ocopy >X1 -#cmp X1 Ref -#log -#next -9.2e 5 diff --git a/usr.bin/learn/lib/editor/L9.2e b/usr.bin/learn/lib/editor/L9.2e deleted file mode 100644 index 15ac77a3452..00000000000 --- a/usr.bin/learn/lib/editor/L9.2e +++ /dev/null @@ -1,21 +0,0 @@ -#print -You can also employ addresses using arithmetic with -this kind of command. For example, what "p" command -would you type to print from line 2 to the line -before the current line of the file? Remember what -the line before the current line is: - .-1 -right? -Type "answer COMMAND" where COMMAND is the specified -"p" command. -#copyin -#user -#uncopyin -#match 2,.-1p -#match 2,-p -#match 2,.-p -#log -#next -10.1a 10 -10.2a 5 -10.3a 2 diff --git a/usr.bin/learn/lib/editor/L9.3c b/usr.bin/learn/lib/editor/L9.3c deleted file mode 100644 index 859ccb0ecf6..00000000000 --- a/usr.bin/learn/lib/editor/L9.3c +++ /dev/null @@ -1,44 +0,0 @@ -#print -You can make up addresses for the 'p' command -using '.' for the current line when there are -two addresses, also. For example, you could -print from the first line up to the present -line with - 1,.p -and I suggest you try that now. After -that command, type the usual - w - q - ready -#create Ref -83 -broccoli -mushrooms -cauliflower -squash -carrots -lettuce -string beans -peas -lima beans -83 -#create file -broccoli -mushrooms -cauliflower -squash -carrots -lettuce -string beans -peas -lima beans -#copyout -#pipe -ed file -#user -#unpipe -#uncopyout -#cmp .ocopy Ref -#log -#next -9.2d 5 diff --git a/usr.bin/learn/lib/eqn/Init b/usr.bin/learn/lib/eqn/Init deleted file mode 100644 index 6e8313db101..00000000000 --- a/usr.bin/learn/lib/eqn/Init +++ /dev/null @@ -1,14 +0,0 @@ -if test x$term != x -then - true - exit -fi -echo 'I need to know what kind of terminal you are using. -I will put you out of learn. Type these two commands - -term=xxx (where xxx is one of 300, 300S, 450, etc.) - (with no spaces!) -export term - -Then type "learn eqn" again.' -false diff --git a/usr.bin/learn/lib/eqn/L0 b/usr.bin/learn/lib/eqn/L0 deleted file mode 100644 index 4da00833205..00000000000 --- a/usr.bin/learn/lib/eqn/L0 +++ /dev/null @@ -1,2 +0,0 @@ -#next -0.1a diff --git a/usr.bin/learn/lib/eqn/L0.1a b/usr.bin/learn/lib/eqn/L0.1a deleted file mode 100644 index 865a9bafd7f..00000000000 --- a/usr.bin/learn/lib/eqn/L0.1a +++ /dev/null @@ -1,53 +0,0 @@ -#once #create message -.EQ -delim $$ -.EN -.pl 1 -.ll 55 -WARNING: This course was written for UNIX in 1979, not 1999, -and has not yet been updated. Some details may be way out of date! -This course in particular may not work well on modern terminals/xterms! - -This script is designed to teach you the "eqn" language -for typing mathematics. -There are two versions of the program. "eqn" is for -use on the phototypesetter; "neqn" is for use on a -terminal like a DASI or GSI, or a Model 37 teletype. -The lessons are mostly written under the assumption -that you will be using neqn on a DASI or GSI or teletype; -a few things that are specific to eqn on the typesetter are -left to the end. - -The terminal MUST be a DASI or GSI or teletype, -or you will get some rather startling results -from this script. - -To verify that everything is working, this message -should come out with subscripts, superscripts, Greek -letters and so on. If it doesn't, we're in -trouble. -.sp -Summation sign: $ sum $ -.sp -Letter pi: $ pi $ -.sp -Subscript and superscript: $ x sub i ~=~ y sup j $ -.sp -If this looks ok, type yes. Otherwise, type no. -.pl 1 -# -#once neqn message | nroff -T$term -#copyin -#user -#uncopyin -#match yes -#fail -Do you have the right kind of terminal? -If you are using a DASI or GSI, make -sure the switch labeled "PLOT" inside the cover -is set to ON. -If these fail, call for help; -otherwise type yes the next time. -#log -#next -1.1a diff --git a/usr.bin/learn/lib/eqn/L1.1a b/usr.bin/learn/lib/eqn/L1.1a deleted file mode 100644 index fbcee8d0f56..00000000000 --- a/usr.bin/learn/lib/eqn/L1.1a +++ /dev/null @@ -1,35 +0,0 @@ -#print -To properly print a file containing an equation, -you have to type a longer-than-usual command line. -If you are using a DASI or GSI, to print a file -"math" that contains mathematics, you must say - - neqn math | nroff -Txxx - -where "-Txxx" describes the terminal you are using. -This is usually one of - -T300 - -T300S - -T450 -It is very important that you get this line right. -If you don't, you'll not be happy with your output. - -In this directory is a file called "Example"; print -it properly, using whichever command line is -appropriate to your terminal. -Then type "ready". -#once #create Example -This is a little file that contains an -example of a subscript and superscript: -.ce -.EQ -a sub i + b sub i ~=~ c sub i sup 2 -.EN -.pl 1 -#copyin -#user -#uncopyin -grep 'neqn Example *| *nroff -T' <.copy >/dev/null -#log -#next -1.1b 10 diff --git a/usr.bin/learn/lib/eqn/L1.1b b/usr.bin/learn/lib/eqn/L1.1b deleted file mode 100644 index 60c00a68fd2..00000000000 --- a/usr.bin/learn/lib/eqn/L1.1b +++ /dev/null @@ -1,51 +0,0 @@ -#print -Most technical papers and memos consist of normal text -interspersed with occasional (or frequent) mathematical -expressions, such as the ones in the last lesson. -To tell neqn that something is mathematics, not normal -text, you must surround it by two "commands": - - A line that begins with - .EQ - marks the start of an expression. - - A line that begins with - .EN - marks the end of the expression. - -Thus, the lines -.EQ -x=y+1 -.EN -represent the equation - -x=y+1 - -The file "Example" in this directory has a line that contains -+ and - signs. Make that line into an equation -by adding .EQ and .EN before and after. -Print "Example" with neqn and nroff (and the appropriate -Txxx), -then type "ready". -#once #create Ref -This is a tiny little text -that includes one equation -or at least it will when you find this line: -.ce -.EQ -a = b + c - d -.EN -and convert it into an equation. -.pl 1 -#once #create Example -This is a tiny little text -that includes one equation -or at least it will when you find this line: -.ce -a = b + c - d -and convert it into an equation. -.pl 1 -#user -#cmp Ref Example -#log -#next -1.1c 10 diff --git a/usr.bin/learn/lib/eqn/L1.1c b/usr.bin/learn/lib/eqn/L1.1c deleted file mode 100644 index 77edb1f8399..00000000000 --- a/usr.bin/learn/lib/eqn/L1.1c +++ /dev/null @@ -1,39 +0,0 @@ -#print -It is usually wise to do your formatting with -the "-ms" macro package developed by Mike Lesk, since -it does a lot of dirty work for you without any effort -on your part. -One of the things "-ms" does is to arrange that equations -are "displayed" - that is, that they are neatly centered -and set off from the surrounding text. -Most of the "-ms" package is described in another script -called "macros", which you may have already learned. -For now, we need only know this much: to use "-ms" -with neqn, add "-ms" to your command line, right after -the word "nroff", like this - - neqn files... | nroff -ms -Txxx - -Notice where the "-ms" goes. - -In this directory is a file called "Example". -To prove that you can type the "-ms" in the right place, -print "Example" with "-ms", then type "ready". -#once #create Example -.PP -This is a tiny little text -that includes one equation -or at least it will when you find this line: -.EQ -x sub i = y sub i -.EN -and convert it into an equation. -(Naturally I changed it.) -.pl 1 -#copyin -#user -#uncopyin -grep 'neqn Example *| *nroff -ms' <.copy >/dev/null -#log -#next -1.1d 10 diff --git a/usr.bin/learn/lib/eqn/L1.1d b/usr.bin/learn/lib/eqn/L1.1d deleted file mode 100644 index 949d4fac050..00000000000 --- a/usr.bin/learn/lib/eqn/L1.1d +++ /dev/null @@ -1,34 +0,0 @@ -#print -The "-ms" package lets you do some other nice things as -well. For example, you can arrange for a number to be -placed on an equation, in the right margin: - - a = b + c - d (1.23) - -by placing the number after the .EQ on the same line, -like this: - -.EQ (1.23) - -You must leave a space between .EQ and the number. - -In the file "Example", number the equation "17.1a" -and print it properly with neqn and nroff -ms. -(Don't forget -Txxx for your terminal.) -Then type "ready". -#once #create Example -.PP -This is a tiny little text -that includes one equation -or at least it will when you find this line: -.EQ -x sub i = y sub i + z sub i -.EN -and convert it into an equation. -(Naturally I changed it again.) -.pl 1 -#user -grep '\.EQ *17\.1a$' <Example >/dev/null -#log -#next -1.1e 10 diff --git a/usr.bin/learn/lib/eqn/L1.1e b/usr.bin/learn/lib/eqn/L1.1e deleted file mode 100644 index bec107f5666..00000000000 --- a/usr.bin/learn/lib/eqn/L1.1e +++ /dev/null @@ -1,30 +0,0 @@ -#print -So far all the equations have been centered, which is what -"-ms" does unless you tell it differently. -You can also arrange for equations to be left-adjusted - -that is, right up against the left margin - by saying - .EQ L -If there is a number, place it _____after the L, separated by a -space, like this: - .EQ L (3a) - -Make the equation in "Example" left-justified with -the number (3.1a) in the right margin and print it -to make sure everything works. Then type "ready". -#once #create Example -.PP -This is a tiny little text -(which you're undoubtedly sick of by now) -that includes one equation -or at least it will when you find this line: -.EQ -x sup i = y sup i -.EN -and convert it into an equation. -(Naturally I changed it.) -.pl 1 -#user -grep '\.EQ *L *(3.1a)$' <Example >/dev/null -#log -#next -1.1f 10 diff --git a/usr.bin/learn/lib/eqn/L1.1f b/usr.bin/learn/lib/eqn/L1.1f deleted file mode 100644 index 72d7e53dd3f..00000000000 --- a/usr.bin/learn/lib/eqn/L1.1f +++ /dev/null @@ -1,87 +0,0 @@ -#print -You can also make equations that are ________indented a fixed amount from -the left margin, with the command - .EQ I -Again, if there is an equation number, it follows the I. - -Convert all the equations in "Example" to indented ones. -(Naturally I've changed it.) -You can do this with a single editor command. - -Print "Example" with neqn and nroff -ms, -then type "ready". -#once #create Ref -.LP - EQUIVALENCES OF ONE SORT AND ANOTHER -.LP -.EQ I (2.01) -bold x sup { n alpha } (t) ~->~ bold x sup alpha ( bold X ,t). -.EN -.sp -.EQ I (2.02) -sum from n F( bold x sup { n alpha } (t)) -~->~ 1 over OMEGA INT F( bold x sup alpha ( bold X ,t))d bold \|X -.EN -.EQ I (2.03) -bold x ( bold X ,t) ~==~ -sum from { alpha =1} to N -rho sup alpha over rho sup 0 bold x sup alpha ( bold X ,t) -.EN -.EQ I (2.08) -sum from {alpha =1} to N -U sup { mu alpha } V sup { mu alpha } ~=~ delta sup { mu nu } -.EN -.EQ I (2.06) -bold y sup { T mu } ( bold X ,t) -~==~ sum from {alpha =1} to N -U sup { mu alpha } -bold x sup alpha -( bold X ,t) -.EN -.EQ I -~ partial over {partial d} - ( epsilon sub 0 bold E sup T times bold B ) sub i -- m sub ij,\|j ~=~ --q sup D E sub i sup T --( bold ~j sup D times bold B ) sub i -.EN -#once #create Example -.LP - EQUIVALENCES OF ONE SORT AND ANOTHER -.LP -.EQ (2.01) -bold x sup { n alpha } (t) ~->~ bold x sup alpha ( bold X ,t). -.EN -.sp -.EQ (2.02) -sum from n F( bold x sup { n alpha } (t)) -~->~ 1 over OMEGA INT F( bold x sup alpha ( bold X ,t))d bold \|X -.EN -.EQ (2.03) -bold x ( bold X ,t) ~==~ -sum from { alpha =1} to N -rho sup alpha over rho sup 0 bold x sup alpha ( bold X ,t) -.EN -.EQ (2.08) -sum from {alpha =1} to N -U sup { mu alpha } V sup { mu alpha } ~=~ delta sup { mu nu } -.EN -.EQ (2.06) -bold y sup { T mu } ( bold X ,t) -~==~ sum from {alpha =1} to N -U sup { mu alpha } -bold x sup alpha -( bold X ,t) -.EN -.EQ -~ partial over {partial d} - ( epsilon sub 0 bold E sup T times bold B ) sub i -- m sub ij,\|j ~=~ --q sup D E sub i sup T --( bold ~j sup D times bold B ) sub i -.EN -#user -#cmp Ref Example -#log -#next -2.1a 10 diff --git a/usr.bin/learn/lib/eqn/L10.1a b/usr.bin/learn/lib/eqn/L10.1a deleted file mode 100644 index 71423a98cea..00000000000 --- a/usr.bin/learn/lib/eqn/L10.1a +++ /dev/null @@ -1,77 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -The next topic goes back to the problem of formatting -equations on the page. Sometimes it is desirable to -line up one part of an equation with some part -of a previous equation - for example, equals signs -are often lined up like this: -.EQ I -x mark = y sub i -.EN -.EQ I -lineup = z sub i -.EN -.EQ I -x sub i + y sub i lineup = z sub i -.EN - -To achieve this, you have to do several things. -(1) tell neqn to remember the place where things are -to be lined up, which is done by saying -"mark" just before the thing you want remembered: - .EQ I - x mark = y sub i - .EN -.br -(2) Then, in successive equations, telling neqn -to line up something on the previous mark, with -"lineup": - .EQ I - lineup = z sub i - .EN -.br -(3) You ____have __to use either ".EQ I" or ".EQ L"; -you can't line things up in a centered equation. - -For practice, modify "Example" so the -equations are lined up on the equals signs, then -type "ready". -.pl 1 -#once #create Ref -.LP -A test of mark and lineup: -.EQ I -x sub i ~ mark =~ 1 -.EN -.EQ I -x sub i + y sub i ~ lineup = ~2 -.EN -.pl 1 -#once #create Example -.LP -A test of mark and lineup: -.EQ I -x sub i ~ =~ 1 -.EN -.EQ I -x sub i + y sub i ~ =~ 2 -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#fail -Don't forget that tilde is a real character; -put the mark and lineup after it. -Remember .EQ I. -#log -#next -10.1b 10 diff --git a/usr.bin/learn/lib/eqn/L10.1b b/usr.bin/learn/lib/eqn/L10.1b deleted file mode 100644 index 5b5c3896a9e..00000000000 --- a/usr.bin/learn/lib/eqn/L10.1b +++ /dev/null @@ -1,42 +0,0 @@ -#print -More practice with mark and lineup. -Modify "Example" so the + signs are lined up in -all of the equations, then type "ready". -#once #create Ref -.LP -.EQ I -x ~==~ a sub i ~ mark + ~ b sub i ~-~ c sub i -.EN -.EQ I -lineup + ~ d sub i - e sub i -.EN -.EQ I -lineup + ~ f sub i - g sub i -.EN -.EQ I -lineup + ~ ... -.EN -.pl 1 -#once #create Example -.LP -.EQ I -x ~==~ a sub i ~ + ~ b sub i ~-~ c sub i -.EN -.EQ I -+ ~ d sub i - e sub i -.EN -.EQ I -+ ~ f sub i - g sub i -.EN -.EQ I -+ ~ ... -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -10.1c 10 diff --git a/usr.bin/learn/lib/eqn/L10.1c b/usr.bin/learn/lib/eqn/L10.1c deleted file mode 100644 index 88e2c2419f9..00000000000 --- a/usr.bin/learn/lib/eqn/L10.1c +++ /dev/null @@ -1,25 +0,0 @@ -#print -There are several warnings in order about mark and lineup. -First, remember that you must use ".EQ I" or ".EQ L". -Second, there can only be one mark or one lineup in any given -equation. -Finally, what you are doing must make sense, or -your results may be not what you wanted. - -Does this sequence produce output with the equals signs -lined up? - .EQ L - x mark = y - .EN - .EQ L - x+y mark = z - .EN -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -11.1a 10 -10.2c 5 diff --git a/usr.bin/learn/lib/eqn/L10.2c b/usr.bin/learn/lib/eqn/L10.2c deleted file mode 100644 index 53e1397550a..00000000000 --- a/usr.bin/learn/lib/eqn/L10.2c +++ /dev/null @@ -1,17 +0,0 @@ -#print -Does this sequence produce output with the equals signs -lined up? - .EQ I - x mark = y - .EN - .EQ I - x+y mark = z - .EN -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -11.1a 10 diff --git a/usr.bin/learn/lib/eqn/L11.1a b/usr.bin/learn/lib/eqn/L11.1a deleted file mode 100644 index a03f703dabb..00000000000 --- a/usr.bin/learn/lib/eqn/L11.1a +++ /dev/null @@ -1,46 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -We have introduced a fair number of "magic" words like -sub and sup and over and pi and sum. What happens if -you need to print an equation that contains one of these -words __as ____text, like this: -.EQ -e sub "pi" -.EN - -The way to turn off special meanings of magic words is -to enclose them in the double quotes "...". The $e sub "pi"$ -was printed with - .EQ - e sub "pi" - .EN - -Using this knowledge, modify file "Example" so it produces output -that looks like the following, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -lim "sup" f( "pi" ) = p cdot i -.EN -.pl 1 -#once #create Example -.LP -.EQ -lim sup f( pi ) = p cdot i -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -11.1b 10 diff --git a/usr.bin/learn/lib/eqn/L11.1b b/usr.bin/learn/lib/eqn/L11.1b deleted file mode 100644 index 06fa2256341..00000000000 --- a/usr.bin/learn/lib/eqn/L11.1b +++ /dev/null @@ -1,34 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -The quoting mechanism can also be used to turn off the special meaning -of things like the dollar sign and braces. -Modify "Example" so it prints the following output, then -type "ready". -.pl 1 -# -#once #create Ref -.EQ -delim $$ -.EN -.LP -The cost of processing is proportional to -$characters over "$"$. -.pl 1 -#once #create Example -.LP -The cost of processing is proportional to -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -11.1c 10 diff --git a/usr.bin/learn/lib/eqn/L11.1c b/usr.bin/learn/lib/eqn/L11.1c deleted file mode 100644 index 3b669c8a0a0..00000000000 --- a/usr.bin/learn/lib/eqn/L11.1c +++ /dev/null @@ -1,31 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -Modify "Example" so it prints the following output, then -type "ready". -.pl 1 -#once #create Ref -.EQ -delim $$ -.EN -.LP -The cost of processing is proportional to -${ "{" characters "}" } over "$"$. -.pl 1 -#once #create Example -.LP -The cost of processing is proportional to -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -11.1d 10 diff --git a/usr.bin/learn/lib/eqn/L11.1d b/usr.bin/learn/lib/eqn/L11.1d deleted file mode 100644 index 8b75cebc5e0..00000000000 --- a/usr.bin/learn/lib/eqn/L11.1d +++ /dev/null @@ -1,18 +0,0 @@ -#print -One thing to keep in mind, although it generally -isn't going to affect you, is that the quote " -is a delimiter just like blank or tilde - -it turns off subscripts and superscripts, and so -on. -Experiment a bit, and decide if - e sup "{t}" -is the same as - e sup "{"t"}" -Type yes if they are the same, no if they are different. -#copyin -#user -#uncopyin -#match no -#log -#next -11.1e 10 diff --git a/usr.bin/learn/lib/eqn/L11.1e b/usr.bin/learn/lib/eqn/L11.1e deleted file mode 100644 index 2c4a35660e6..00000000000 --- a/usr.bin/learn/lib/eqn/L11.1e +++ /dev/null @@ -1,26 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -Sometimes there will be a need for a subscript or superscript -that has nothing to the left of it, as in references like - $"" sup 1$Smith, J. `A great paper...' - -Experiment and decide if you can get this effect -by writing simply - %sup 1%Smith, J..... - -Type yes if this works, no if it does not. -.pl 1 -# -#once neqn message | nroff -T$term %s/tinyms - -#copyin -#user -#uncopyin -#match no -#log -#next -11.1f 10 diff --git a/usr.bin/learn/lib/eqn/L11.1f b/usr.bin/learn/lib/eqn/L11.1f deleted file mode 100644 index 0a726f4babf..00000000000 --- a/usr.bin/learn/lib/eqn/L11.1f +++ /dev/null @@ -1,48 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -The way to handle the problem of a subscript or superscript -on nothing is to provide something to hang the subscript -or superscript on. -One possibility is to use a tilde, but that has a real width, -and might spoil the appearance of the output. -The best solution is this: - - "" sup 1 ... - -The expression "" has no width, so everything works -out properly. The use of "" may seem a bit unnatural -but it's an idiom that you get used to quite quickly. - -For practice, modify "Example" so it produces -output that looks like this, -then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -"" sup + H sub 2 ~ "<=>" ~ "" sup - H ~+~ "" sup + H -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxx -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#fail -Don't forget spaces; don't forget to quote -things when needed (including <=>). -#log -#next -11.1g 10 diff --git a/usr.bin/learn/lib/eqn/L11.1g b/usr.bin/learn/lib/eqn/L11.1g deleted file mode 100644 index 66216e15aab..00000000000 --- a/usr.bin/learn/lib/eqn/L11.1g +++ /dev/null @@ -1,32 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -For practice, modify "Example" so it produces -output that looks like this, -then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -{ lim ~ "sup" } bar ~f(x) ~=~ x -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxx -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -12.1a 10 diff --git a/usr.bin/learn/lib/eqn/L12.1a b/usr.bin/learn/lib/eqn/L12.1a deleted file mode 100644 index a9382b60dac..00000000000 --- a/usr.bin/learn/lib/eqn/L12.1a +++ /dev/null @@ -1,53 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -The next step is to learn how to put big parentheses, -brackets, braces or bars around equations, like this: -.EQ -left | a sup 2 over b sub i right | -.EN - -This is done with two new words called "left" and "right". -To put bars around something, you simply say, in the middle -of an equation, - left | something right | -and the job is done. -"something" can indeed be anything, from a single letter -up to some horribly complicated mess. -The bars grow to the right height to cover the -"something", automatically. -To produce the example above, all that was needed was - .EQ - left | a sup 2 over b sub i right | - .EN - -For practice, modify file "Example" so it produces output -that looks like this, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -left | -{a over b ~+~ c over d} over 2 -right | -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -12.1b 10 diff --git a/usr.bin/learn/lib/eqn/L12.1b b/usr.bin/learn/lib/eqn/L12.1b deleted file mode 100644 index 6886309a61b..00000000000 --- a/usr.bin/learn/lib/eqn/L12.1b +++ /dev/null @@ -1,29 +0,0 @@ -#print -Bars are not the only characters you can put -around an equation. -If you say - left ( thing right ) -you will get large parentheses around "thing". -You can also use [ and ] for large square brackets -and { and } for large braces. - -The main problem is that on your terminal there is -no good way for neqn to draw large braces -or brackets or parens. So neqn replaces all of these -with bars. -Use the right character anyway, though - things do -work properly on the typesetter. And who knows, some day -neqn may get improved as well. - -With the current version of neqn, does the input - left { a over b right } -produce the same output as - left [ a over b right ] -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -12.1c 10 diff --git a/usr.bin/learn/lib/eqn/L12.1c b/usr.bin/learn/lib/eqn/L12.1c deleted file mode 100644 index 20bf122ccbd..00000000000 --- a/usr.bin/learn/lib/eqn/L12.1c +++ /dev/null @@ -1,44 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -Of course the thing with bars or braces around it can -still be part of larger expressions: the input - .EQ - left | {a over b ~+~ c over d} over 2 right | over a+b+c+d - .EN -produces -.EQ -left | {a over b ~+~ c over d} over 2 right | over a+b+c+d -.EN - -For practice, modify file "Example" so it produces output -that looks like this, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -left | -{a over b ~+~ c over d} over 2 -right | -sup half -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -12.1d 10 diff --git a/usr.bin/learn/lib/eqn/L12.1d b/usr.bin/learn/lib/eqn/L12.1d deleted file mode 100644 index 32f1d480e8c..00000000000 --- a/usr.bin/learn/lib/eqn/L12.1d +++ /dev/null @@ -1,21 +0,0 @@ -#print -.LP -The "right" part of a left-right construction can be -omitted if it is not used; just leave that part out. -The main thing to watch out for is that now you will -need braces to enclose the entire construction, "left" and all - -otherwise neqn will not know where to stop in -figuring out how high the thing is. - -For example, will - left "{" a + b over c over d -produce the same output as - { left "{" a } + b over c over d -Answer yes or no after experimenting. -#copyin -#user -#uncopyin -#match no -#log -#next -12.1e 10 diff --git a/usr.bin/learn/lib/eqn/L12.1e b/usr.bin/learn/lib/eqn/L12.1e deleted file mode 100644 index fc78d36289a..00000000000 --- a/usr.bin/learn/lib/eqn/L12.1e +++ /dev/null @@ -1,43 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.PP -There are also occasions when you want to omit -the left part and keep the right part. -This is a bit more complicated, since for obscure -reasons neqn won't let you actually leave the -left part out completely. -But you can ask it to print no character, -instead of using bars, by saying - left "" thing right | -.LP -This is similar to the way we used quotes before, to get -a zero-width thing before a superscript. - -For practice, modify file "Example" so it produces output -that looks like this, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -left "" -int from 0 to {2 pi} sin (x) dx ~=~ -cos (x) right | sub 0 sup {2 pi} -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log diff --git a/usr.bin/learn/lib/eqn/L2.1a b/usr.bin/learn/lib/eqn/L2.1a deleted file mode 100644 index cf2956cdd19..00000000000 --- a/usr.bin/learn/lib/eqn/L2.1a +++ /dev/null @@ -1,38 +0,0 @@ -#print -You may have noticed that neqn threw away the spaces -in several of the examples we did. For example, in -.EQ -a = b + c - d -.EN -the output equation looks like -a=b+c-d -regardless of spaces in the input. - -Spaces are always thrown away, and so are new lines - you -can type an equation on as many lines as you like. -This latitude is permitted mainly to make it easy to type equations - -longer equations are easier to edit when they are typed -as a series of short input lines instead of one giant -one. - -Will the printed output of this equation -.EQ -a -+ -b -+ -c -.EN -be any different from this one? -.EQ -a+b+c -.EN -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -2.1b 10 -2.2a 5 diff --git a/usr.bin/learn/lib/eqn/L2.1b b/usr.bin/learn/lib/eqn/L2.1b deleted file mode 100644 index 277f17e41c6..00000000000 --- a/usr.bin/learn/lib/eqn/L2.1b +++ /dev/null @@ -1,50 +0,0 @@ -#print -Since spaces are thrown away, what do you do when -you want spaces? The answer is that you have to ask for -them explicitly. -If you type a "~" (tilde) it will be replaced by a space -on output; use one tilde for each space. -Thus to get -a + b -you need -.EQ -a~+~b -.EN - -Modify the equation in file "Example" so there is one space -around each of the operators =, + and -, so it looks like - -a = b + c - d - -Print it with neqn and nroff -ms to verify it. -Type "ready" when done. -#once #create Ref -.PP -You probably thought you were done with this ridiculous -example of just -.EQ -a ~=~ -b ~+~ c -~-~d -.EN -Sorry, but you will probably even see it again. -.pl 1 -#once neqn Ref | nroff >X1 & -#once #create Example -.PP -You probably thought you were done with this ridiculous -example of just -.EQ -a = -b + c --d -.EN -Sorry, but you will probably even see it again. -.pl 1 -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -2.1c 10 -2.2b 5 diff --git a/usr.bin/learn/lib/eqn/L2.1c b/usr.bin/learn/lib/eqn/L2.1c deleted file mode 100644 index 37a4b313fa8..00000000000 --- a/usr.bin/learn/lib/eqn/L2.1c +++ /dev/null @@ -1,57 +0,0 @@ -#once #create message -.nf -.EQ -delim $$ -.EN -Several of the examples we did earlier had Greek letters -and other mathematical symbols in them. -The way to get things like $pi$ and $sum$ and $int$ is -rather easy - you just spell out their names, like this: - -$pi$ is pi - -$sum$ is sum - -$int$ is int - -and so on. -The main thing you must always remember about these names -is that when they appear in an equation, they must be -separated from surrounding symbols by blanks or tildes, -OR THEY WILL NOT BE RECOGNIZED. - -For practice, modify "Example" so the symbol $partial$ -is replaced by $sum$ everywhere it appears. -Type "ready" when you're done. -.pl 1 -#once #create Ref -.PP -The symbol -.EQ -sum -.EN -often appears in lines like -.EQ -{ sum x } over { sum y } = y over x -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message | nroff -T$term -#once #create Example -.PP -The symbol -.EQ -partial -.EN -often appears in lines like -.EQ -{ partial x } over { partial y } = y over x -.EN -.pl 1 -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -2.1d 10 diff --git a/usr.bin/learn/lib/eqn/L2.1d b/usr.bin/learn/lib/eqn/L2.1d deleted file mode 100644 index 22bb134613f..00000000000 --- a/usr.bin/learn/lib/eqn/L2.1d +++ /dev/null @@ -1,57 +0,0 @@ -#print -The file "Chars" contains a longer list of characters that -you can obtain with neqn. -Print the file "Chars" with neqn and nroff -ms, then -type "ready". (Don't forget -Txxx.) -#once #create Chars -.LP -.EQ -delim $$ -.EN -.nf -$alpha$ alpha -$beta$ beta -$gamma$ gamma -$GAMMA$ GAMMA -$delta$ delta -$DELTA$ DELTA -$epsilon$ epsilon -$zeta$ zeta -$eta$ eta -$THETA$ THETA -$theta$ theta -$lambda$ lambda -$LAMBDA$ LAMBDA -$mu$ mu -$nu$ nu -$xi$ xi -$pi$ pi -$PI$ PI -$rho$ rho -$sigma$ sigma -$SIGMA$ SIGMA -$tau$ tau -$phi$ phi -$PHI$ PHI -$psi$ psi -$PSI$ PSI -$omega$ omega -$OMEGA$ OMEGA -$partial$ partial -$integral$ integral -$int$ int -$sum$ sum -$prod$ prod -$<=$ <= -$>=$ >= -$==$ == -$cdot$ cdot -$...$ ... -.pl 1 -#copyin -#user -#uncopyin -grep 'neqn Chars *| *nroff' <.copy >/dev/null -#log -#next -2.1e 10 diff --git a/usr.bin/learn/lib/eqn/L2.1e b/usr.bin/learn/lib/eqn/L2.1e deleted file mode 100644 index bf6eb69e147..00000000000 --- a/usr.bin/learn/lib/eqn/L2.1e +++ /dev/null @@ -1,34 +0,0 @@ -#once #create message -.ND -.PP -For practice, in this directory there is a file called -"Example". It contains an equation. Make it -look like this: -.EQ -int from i to j f( pi ) ~=~ LAMBDA (x) -.EN -by changing the character names as appropriate -and adding spaces where needed. -Type "ready" when you're satisfied. -.pl 1 -#once neqn message | nroff -T$term %s/tinyms - -#once #create Ref -.LP -.EQ -int from i to j f( pi ) ~=~ LAMBDA (x) -.EN -.pl 1 -#once #create Example -.LP -.EQ -sum from i to j f(q) = lambda (x) -.EN -.pl 1 -#once neqn Ref | nroff >X2 & -#user -neqn Example | nroff >X1 -#cmp X1 X2 -#log -#next -2.1f 10 -2.2e 5 diff --git a/usr.bin/learn/lib/eqn/L2.1f b/usr.bin/learn/lib/eqn/L2.1f deleted file mode 100644 index 70acf0e2886..00000000000 --- a/usr.bin/learn/lib/eqn/L2.1f +++ /dev/null @@ -1,46 +0,0 @@ -#once #create message -.ND -.LP -One of the most common problems in using neqn is forgetting -to leave spaces or tildes around "magic" words like "pi" -or "int" or "sum". The result is that the magic words -cease to be magic, and just look like ordinary strings -of letters. - -In the file "Example", there are several such errors. -Find them, and fix them so the output looks -like this, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -sum ~=~ pi ~+~1 -.EN -.EQ -a~=~ pi (x) -.EN -.EQ -alpha ~=~ beta ~+~ gamma ~+~ delta -.EN -.pl 1 -#once #create Example -.LP -.EQ -sum=pi+1 -.EN -.EQ -a=pi(x) -.EN -.EQ -alpha=beta+gamma+delta -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -3.1a 10 diff --git a/usr.bin/learn/lib/eqn/L2.2a b/usr.bin/learn/lib/eqn/L2.2a deleted file mode 100644 index e7820cd4f84..00000000000 --- a/usr.bin/learn/lib/eqn/L2.2a +++ /dev/null @@ -1,25 +0,0 @@ -#print -Will the output from the first equation below be different -from the second? - -.EQ -X = Y -+Z -.EN - -.EQ -x = y -+ z -.EN - -Answer yes if they will be different, -no if they will be the same. -#copyin -#user -#uncopyin -#match yes -#fail -Look more closely at ____what letters are being printed. -#log -#next -2.1b 10 diff --git a/usr.bin/learn/lib/eqn/L2.2b b/usr.bin/learn/lib/eqn/L2.2b deleted file mode 100644 index 13bcad1cfe6..00000000000 --- a/usr.bin/learn/lib/eqn/L2.2b +++ /dev/null @@ -1,38 +0,0 @@ -#print -One more example of spaces before getting on to something -new. -In the file "Example", change the spacing so the equation -reads - -a = b+c-d - -Print the example with "-ms". -Type "ready" when you're done. -#once #create Ref -.PP -Here it is again. One example goes a long way. -.EQ -a ~=~ -b + c --d -.EN -Sorry, but you will probably even see it again. -.pl 1 -#once #create Example -.PP -Here it is again. One example goes a long way. -.EQ -a = -b + c --d -.EN -Sorry, but you will probably even see it again. -.pl 1 -# -#once neqn Ref | nroff >X1 & -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -2.1c 10 diff --git a/usr.bin/learn/lib/eqn/L2.2e b/usr.bin/learn/lib/eqn/L2.2e deleted file mode 100644 index a4b3dac4bae..00000000000 --- a/usr.bin/learn/lib/eqn/L2.2e +++ /dev/null @@ -1,37 +0,0 @@ -#print -Make the two equations in "Example" look like these two, -then type "ready". - -#once #create Ref -.ND -.LP -.EQ (1.1) -PI ~=~ ( pi sub 1 , pi sub 2 ,..., pi sub n ) -.EN -.EQ (1.2) -pi bar ~=~ sum ( alpha , beta ) -.EN -.pl 1 -#once #create Example -.ND -.LP -.EQ -PHI = ( phi sub 1 , phi sub 2 ,..., phi sub n ) -.EN -.EQ -phi bar = sum (A,B) -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#fail -Don't forget equation numbering and spaces -where needed. Print file "Chars" if you've forgotten -the character names. -#log -#next -2.1f diff --git a/usr.bin/learn/lib/eqn/L3.1a b/usr.bin/learn/lib/eqn/L3.1a deleted file mode 100644 index a33f08973a2..00000000000 --- a/usr.bin/learn/lib/eqn/L3.1a +++ /dev/null @@ -1,53 +0,0 @@ -#once #create message -.ND -.PP -Now that we have some of the preliminaries out of the way, -we can get on to doing real mathematics. -I have been slipping small things into the example files -as we go along so that you will at least have seen -some common neqn constructions. - -One of the most frequent is the word "sub", which -indicates a subscript, like this: - - .EQ - x sub i + y sub j - .EN - -which produces -.EQ -x sub i + y sub j -.EN -The main thing to notice is that the blanks are delimiters - -the subscript of "x" is "i"; the blank after the "i" marks -the end of the subscript. - -Modify the file "Example" so the equation in it looks like -this: -.EQ -x sub alpha ~=~ y sub pi ~+~ z sub pi -.EN -Then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -x sub alpha ~=~ y sub pi ~+~ z sub pi -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxx -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -3.1b 10 -3.2a 5 diff --git a/usr.bin/learn/lib/eqn/L3.1b b/usr.bin/learn/lib/eqn/L3.1b deleted file mode 100644 index 6fe31e213fe..00000000000 --- a/usr.bin/learn/lib/eqn/L3.1b +++ /dev/null @@ -1,41 +0,0 @@ -#once #create message -.ND -.PP -Naturally there is a superscript operation that's exactly -like "sub", except that it goes up instead of down. -It is called "sup". To make -.EQ -x sup i+j -.EN -for example, you type - .EQ - x sup i+j - .EN - -Make the file "Example" produce the same output -as the following, then type "ready". -#once #create Ref -.LP -.EQ -x sup alpha ~=~ y sup pi ~+~ z sup pi -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxx -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#fail -Don't forget that there are spaces -around the = and +. -#cmp X1 X2 -#log -#next -3.1c 10 diff --git a/usr.bin/learn/lib/eqn/L3.1c b/usr.bin/learn/lib/eqn/L3.1c deleted file mode 100644 index 2cc13fd2bcc..00000000000 --- a/usr.bin/learn/lib/eqn/L3.1c +++ /dev/null @@ -1,39 +0,0 @@ -#once #create message -.ND -.PP -Subscripts and superscripts can appear in the same equation, -and any subscripted or superscripted thing can have -a subscript or superscript. -For example, you can say - - .EQ - x sub i sub j ~+~ y sup i sup j - .EN - -to get -.EQ -x sub i sub j ~+~ y sup i sup j -.EN -Modify "Example" to produce the following output, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -2 sup 2 sup 2 sup 2 ~=~ 65536 -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxx -.EN -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -3.1d 10 -3.2c 5 diff --git a/usr.bin/learn/lib/eqn/L3.1d b/usr.bin/learn/lib/eqn/L3.1d deleted file mode 100644 index d3848c18cdf..00000000000 --- a/usr.bin/learn/lib/eqn/L3.1d +++ /dev/null @@ -1,49 +0,0 @@ -#once #create message -.ND -.PP -There is one special construction with subscripts -and superscripts that you have to be aware of, although -it almost always does what you want automatically. -When something has both a subscript and a superscript, -it is usually printed as -.EQ -x sub i sup j -.EN -instead of -.EQ -{x sub i} sup j -.EN -To produce this effect, with the superscript _____above the -subscript instead of to the right, you have to type -the subscript ______before the superscript, like this: - - .EQ - x sub i sup j - .EN - -That's all there is to it. - -Modify "Example" to produce the following output, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -x sub ij sup kmn = y sub i sub j -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxx -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -3.1e 10 -3.2d 5 diff --git a/usr.bin/learn/lib/eqn/L3.1e b/usr.bin/learn/lib/eqn/L3.1e deleted file mode 100644 index 49fdba797c9..00000000000 --- a/usr.bin/learn/lib/eqn/L3.1e +++ /dev/null @@ -1,41 +0,0 @@ -#once #create message -.ND -.PP -One common typing error that you should watch out for -is forgetting to end a superscript or subscript -with a blank or other delimiter (like tilde). -For instance, you often see output like -.EQ -f(x sup 2)=1 -.EN -because there wasn't a space left between the 2 and the ). -What we really wanted, of course, was -.EQ -f(x sup 2 )=1 -.EN - -Modify "Example" to produce this output, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -g( x sup pi ) -= pi (gx sup 2 ) -.EN -.pl 1 -#once #create Example -.LP -.EQ -g( x sup pi) -=pi(gxsup2) -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -4.1a 10 diff --git a/usr.bin/learn/lib/eqn/L3.2a b/usr.bin/learn/lib/eqn/L3.2a deleted file mode 100644 index 9c55cd50bd5..00000000000 --- a/usr.bin/learn/lib/eqn/L3.2a +++ /dev/null @@ -1,14 +0,0 @@ -#print -Do - x sub i +y sub j -and - x sub i+y sub j -produce the same output? -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -3.1b 10 diff --git a/usr.bin/learn/lib/eqn/L3.2c b/usr.bin/learn/lib/eqn/L3.2c deleted file mode 100644 index 267c01eaca6..00000000000 --- a/usr.bin/learn/lib/eqn/L3.2c +++ /dev/null @@ -1,25 +0,0 @@ -#once #create message -.ND -.PP -Modify "Example" to produce this output, then type "ready". -#once #create Ref -.LP -.EQ -x sup 2 + y sup 2 = z sup 2 -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxx -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -3.1d 10 diff --git a/usr.bin/learn/lib/eqn/L3.2d b/usr.bin/learn/lib/eqn/L3.2d deleted file mode 100644 index ee3fd49c8a1..00000000000 --- a/usr.bin/learn/lib/eqn/L3.2d +++ /dev/null @@ -1,17 +0,0 @@ -#print -Does the equation - - x sup pi sub i - -produce the same output as - - x sub i sup pi - -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -3.1e 10 diff --git a/usr.bin/learn/lib/eqn/L4.1a b/usr.bin/learn/lib/eqn/L4.1a deleted file mode 100644 index a4942907159..00000000000 --- a/usr.bin/learn/lib/eqn/L4.1a +++ /dev/null @@ -1,42 +0,0 @@ -#once #create message -.ND -.EQ -delim $$ -.EN -.LP -The next neqn word to learn is "over", which makes -fractions like -.EQ -a+b over c -.EN -In fact that line was made by - .EQ - a+b over c - .EN -To begin with an easy one, reproduce -the equation below in the file "Example", then type -ready. -(To get $>=$, type ">=".) -.pl 1 -#once #create Ref -.LP -.EQ -x+1 over y+1 ~>=~ x over y -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -4.1b 10 -4.2a 5 diff --git a/usr.bin/learn/lib/eqn/L4.1b b/usr.bin/learn/lib/eqn/L4.1b deleted file mode 100644 index a989edde18b..00000000000 --- a/usr.bin/learn/lib/eqn/L4.1b +++ /dev/null @@ -1,33 +0,0 @@ -#once #create message -.ND -.LP -Of course you can use reserved words like "pi" or "int" -with the "over" construction. For example, modify -"Example" so its output looks like the following, then -type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -alpha over beta ~=~ pi over 2 -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#fail -The names are alpha, beta and pi. -I hope your trouble wasn't any more -complicated than that. -#log -#next -4.1c 10 diff --git a/usr.bin/learn/lib/eqn/L4.1c b/usr.bin/learn/lib/eqn/L4.1c deleted file mode 100644 index 5ebbd5b1e3b..00000000000 --- a/usr.bin/learn/lib/eqn/L4.1c +++ /dev/null @@ -1,20 +0,0 @@ -#print -Does the neqn input - .EQ - a - over - b - .EN -produce the same output as the input - .EQ - a over b - .EN -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -4.1d 10 -4.2c 5 diff --git a/usr.bin/learn/lib/eqn/L4.1d b/usr.bin/learn/lib/eqn/L4.1d deleted file mode 100644 index 1eea10d9916..00000000000 --- a/usr.bin/learn/lib/eqn/L4.1d +++ /dev/null @@ -1,41 +0,0 @@ -#once #create message -.ND -.LP -You can put fractions over fractions with multiple "over"'s -just as you can do multiple subscripts and superscripts, -although fractions within fractions are much -less common (probably because they are harder for -people to read). -Anyway, if you want, for example, something like -.EQ -a over b over c -.EN -you just type - .EQ - a over b over c - .EN - -As a drill, change "Example" so it produces an equation -that looks like the following one, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -x over x+x over x+x+x -.EN -.pl 1 -#once #create Example -.LP -.EQ -right here -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -5.1a diff --git a/usr.bin/learn/lib/eqn/L4.2a b/usr.bin/learn/lib/eqn/L4.2a deleted file mode 100644 index 223612e867c..00000000000 --- a/usr.bin/learn/lib/eqn/L4.2a +++ /dev/null @@ -1,28 +0,0 @@ -#once #create message -.ND -.LP -Another practice one for using "over". -Modify the file "Example" so it produces -output that looks like this one, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -a + b over c + d = e over f -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -4.1b 10 diff --git a/usr.bin/learn/lib/eqn/L4.2c b/usr.bin/learn/lib/eqn/L4.2c deleted file mode 100644 index 84b786f0904..00000000000 --- a/usr.bin/learn/lib/eqn/L4.2c +++ /dev/null @@ -1,19 +0,0 @@ -#print -Does the neqn input - .EQ - ~a - over - b~ - .EN -produce the same output as the input - .EQ - a~ over ~b - .EN -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -4.1d 10 diff --git a/usr.bin/learn/lib/eqn/L5.1a b/usr.bin/learn/lib/eqn/L5.1a deleted file mode 100644 index b867a59f712..00000000000 --- a/usr.bin/learn/lib/eqn/L5.1a +++ /dev/null @@ -1,45 +0,0 @@ -#once #create message -.ND -.EQ -delim $$ -.EN -.LP -So far we have carefully skirted around a potential -problem; maybe you've wondered about it. -Suppose we want to produce an equation that looks -like this: -.EQ -x sup { pi + 1 } -.EN -The superscript is complicated, in that it contains -both a $pi$ and a +1, which has to be separated -from the $pi$ by a blank. -But I already told you that a blank terminates -the superscript. What's going on? - -As the first step to finding out, will the input -equation - - x sup pi + 1 - -produce the output - - $x sup {pi + 1}$ ? -Answer yes or no. -(You can play with the file "Example" if you like.) -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn message | nroff -T$term %s/tinyms - -#copyin -#user -#uncopyin -#match no -#log -#next -5.1b diff --git a/usr.bin/learn/lib/eqn/L5.1b b/usr.bin/learn/lib/eqn/L5.1b deleted file mode 100644 index 64e952f1195..00000000000 --- a/usr.bin/learn/lib/eqn/L5.1b +++ /dev/null @@ -1,47 +0,0 @@ -#once #create message -.ND -.EQ -delim $$ -.EN -.LP -The problem is really that we need a way to tell neqn -that in spite of blanks, a group of things (like the $pi$ -and the +1) have to be kept together as a single superscript. -The way that this is done is to enclose the group in -braces - the characters { and } - like this: - - .EQ - x sup {pi + 1} - .EN - -This tells neqn that everything inside the braces belongs -to the superscript, in spite of blanks and tildes. -(You don't need blanks before and after braces themselves - -like tildes, they act as delimiters.) - -Modify the file "Example" so that the output looks like -the following, then type "ready". -(To get $==$, type "==".) -.pl 1 -#once #create Ref -.LP -.EQ -x sup {pi +1} == y sup z sup {alpha + beta} -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -5.1c 10 -5.2b 5 diff --git a/usr.bin/learn/lib/eqn/L5.1c b/usr.bin/learn/lib/eqn/L5.1c deleted file mode 100644 index 2b77825c26a..00000000000 --- a/usr.bin/learn/lib/eqn/L5.1c +++ /dev/null @@ -1,40 +0,0 @@ -#once #create message -.ND -.EQ -delim $$ -.EN -.LP -Braces are an exceedingly useful construction. -Wherever you have a place where you could have used -a single thing like the letter "x", you can plug in -anything in braces, and the whole thing will -be positioned properly. You can use braces with sub and sup -and over, and all the other magic words we -haven't seen yet. - -First let's use braces with "over". -Modify "Example" to produce this output, then -type "ready". -(Recall that $partial$ is called "partial".) -.pl 1 -#once #create Ref -.LP -.EQ -{partial y} over {partial x} ~=~ alpha over {alpha +1} -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -5.1d 10 diff --git a/usr.bin/learn/lib/eqn/L5.1d b/usr.bin/learn/lib/eqn/L5.1d deleted file mode 100644 index 7b22c337cb5..00000000000 --- a/usr.bin/learn/lib/eqn/L5.1d +++ /dev/null @@ -1,57 +0,0 @@ -#once #create message -.ND -.EQ -delim $$ -.EN -.LP -You will get lots of practice -using braces as we go along. -One thing to keep in mind is that -braces can appear ______within braces. -(Remember that I said that anywhere you -could use an "x" you could put something in -braces instead. So to get this: -.EQ -e sup {x sup {pi +1} + y sup {pi +1}} -.EN -you can type - - e sup {x sup {pi +1} + y sup {pi +1}} - -The big superscript (the one on the "e") has -a pair of braces that take in everything. -Then the "x" and the "y" each have braces -to delimit their superscripts. -Of course the braces have to go in the right -places, or you won't get the output you -want. - -To verify that you are still following this -lesson, modify "Example" so it looks like -this, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -e sup { - {x sup {pi +1} + y sup {pi +1}} over 2} -.EN -.pl 1 -#once #create Example -.LP -.EQ -e sup {x sup {pi +1} + y sup {pi +1}} -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#fail -Don't forget that you need braces for the overall superscript, -and also for the "over" part. -#log -#next -5.1e 10 -5.2d 5 diff --git a/usr.bin/learn/lib/eqn/L5.1e b/usr.bin/learn/lib/eqn/L5.1e deleted file mode 100644 index 79a845abad6..00000000000 --- a/usr.bin/learn/lib/eqn/L5.1e +++ /dev/null @@ -1,40 +0,0 @@ -#print -Once you start using braces, there are a number of -mistakes that you can make. For example, you can -leave a brace out, or you can get them out of order -(Like } xxx { ), or you can get them in illegal places. -For all of these, neqn tells you "syntax error", -then tries to say what file and line numbers are -involved. -The line numbers are often not exact, but -they are very close. When you get such a message, -print a line or two before and after the line -numbers named in the syntax error message. - -The file "Example" contains a syntax error. -What line does neqn believe it begins on? -Type "answer N", where N is the line number. -#once #create Example -.LP -.EQ 3 -e sup -x sup 2 + e sup -x sub i sup 2 + e sup{-x sub i}sup 2 -.EN -.EQ 4 - e sup{-{x sub i sup 2 + y sub i sup 2}over 2} -= e sup{- x over y} -.EN -.EQ 5 -a over b = c over d = A over B times C over D -.EN -.EQ 8 -B sub a sub 2 + -B sub a sup 2 +B{ sub a}sup 2 + (B sub a ) sup 2 + (B sup 2 ) sub a -+B sup 2 sup x -.EN -#copyin -#user -#uncopyin -#match 13 -#log -#next -5.1f 10 diff --git a/usr.bin/learn/lib/eqn/L5.1f b/usr.bin/learn/lib/eqn/L5.1f deleted file mode 100644 index 14b48bd42d0..00000000000 --- a/usr.bin/learn/lib/eqn/L5.1f +++ /dev/null @@ -1,11 +0,0 @@ -#print -Is the construction - a {sup pi +1} -legal in neqn? Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -5.1g 10 diff --git a/usr.bin/learn/lib/eqn/L5.1g b/usr.bin/learn/lib/eqn/L5.1g deleted file mode 100644 index 046420c1e69..00000000000 --- a/usr.bin/learn/lib/eqn/L5.1g +++ /dev/null @@ -1,17 +0,0 @@ -#print -It is often possible to leave out braces, -but when you do be sure that you get the -answer you really wanted. -For example, does - x sup a over b -produce the same output as - x sup {a over b} -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -5.1h 10 -5.2g 5 diff --git a/usr.bin/learn/lib/eqn/L5.1h b/usr.bin/learn/lib/eqn/L5.1h deleted file mode 100644 index af14087fe1b..00000000000 --- a/usr.bin/learn/lib/eqn/L5.1h +++ /dev/null @@ -1,48 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -One thing that you will occasionally need -is to be able to get a literal { or } in your -output, for an expression like -.EQ -{ "{" a + b "}" } over 2 -.EN -The way to do this is to place the braces -that are really to appear ______inside ______quotes, -like this: - .EQ - { "{" a + b "}" } over 2 - .EN -.br -The quotes temporarily turn off the special meaning -of the braces so that you can have them printed. - -The file "Example" has a lot of square brackets in -it. Modify them so they are all braces when they are -printed - so they look like this - then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -f"{" x sub 1 ,..., x sub n "}" ~=~ "{" x sub 1 ,..., x sub n "}" -.EN -.pl 1 -#once #create Example -.LP -.EQ -f[ x sub 1 ,..., x sub n ] ~=~ [ x sub 1 ,..., x sub n ] -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -6.1a 10 diff --git a/usr.bin/learn/lib/eqn/L5.2b b/usr.bin/learn/lib/eqn/L5.2b deleted file mode 100644 index 924e401973b..00000000000 --- a/usr.bin/learn/lib/eqn/L5.2b +++ /dev/null @@ -1,32 +0,0 @@ -#once #create message -.ND -.EQ -delim $$ -.EN -.LP -Try another example with braces, for practice. -Make the file "Example" produce output that looks -like this line, then type "ready". -(The character $rho$ is "rho".) -.pl 1 -#once #create Ref -.LP -.EQ -alpha sub i sup {pi + rho + 1} ~=~ 1 -.EN -.pl 1 -#once #create Example -.LP -.EQ -replace me -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -5.1c 10 diff --git a/usr.bin/learn/lib/eqn/L5.2d b/usr.bin/learn/lib/eqn/L5.2d deleted file mode 100644 index a6ab2e11679..00000000000 --- a/usr.bin/learn/lib/eqn/L5.2d +++ /dev/null @@ -1,31 +0,0 @@ -#once #create message -.ND -.EQ -delim $$ -.EN -.LP -Modify "Example" so it produces this output, then -type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -{partial e sup {-{x sup 2 + y sup 2} over 2}} over -{partial x} ~=~ f(x) -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxxx -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -5.1e 10 diff --git a/usr.bin/learn/lib/eqn/L5.2g b/usr.bin/learn/lib/eqn/L5.2g deleted file mode 100644 index c3238cc50e2..00000000000 --- a/usr.bin/learn/lib/eqn/L5.2g +++ /dev/null @@ -1,13 +0,0 @@ -#print -Does - x sup a over b -produce the same output as - {x sup a} over b -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -5.1h 10 diff --git a/usr.bin/learn/lib/eqn/L6.1a b/usr.bin/learn/lib/eqn/L6.1a deleted file mode 100644 index fc51f1fa4b6..00000000000 --- a/usr.bin/learn/lib/eqn/L6.1a +++ /dev/null @@ -1,60 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -So far every equation you have typed in -has been "displayed" - neatly centered or indented, and -offset from the surrounding text. -But not all equations are like that. -Very often they appear right in the middle of -running text as subscripts like $x sub i$ or special characters -like $pi$ or $partial$. How are these done? - -The idea is this. Two characters (which may be identical) -are set aside as "delimiters". When the -left delimiter is seen anywhere in ___any line, -it marks the beginning of an in-line equation. -The end is marked by the right delimiter. Between the -delimiters, all the normal rules of neqn apply. - -Suppose we say the delimiters are % signs. -Then to get $pi$, you have to type %pi%. - -To make sure that you can do this much, find the -$pi$, $alpha$ and $sum$ characters in "Example" -and make them into in-line equations. -Use % and % as the delimiter characters. -(This is the most frequent choice, by the way.) -Type "ready" when you're done. -.pl 1 -#once #create Ref -.EQ -delim $$ -.EN -.LP -This line contains some $pi$ and $alpha$ Greek -and $sum$ as well. Don't forget that spaces -inside dollar signs are ignored, while spaces -outside them are significant. -.pl 1 -#once #create Example -.EQ -delim $$ -.EN -.LP -This line contains some pi and alpha Greek -and sum as well. Don't forget that spaces -inside dollar signs are ignored, while spaces -outside them are significant. -.pl 1 -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -6.1b diff --git a/usr.bin/learn/lib/eqn/L6.1b b/usr.bin/learn/lib/eqn/L6.1b deleted file mode 100644 index 743e5ffd9f5..00000000000 --- a/usr.bin/learn/lib/eqn/L6.1b +++ /dev/null @@ -1,37 +0,0 @@ -#print -There is one other thing you have to do before -you can use a character as a delimiter - you -have to tell neqn that you are going to. -To do this, as the very first thing in your -input you must put these three lines: - -.EQ -delim $$ -.EN - -(If you like, other characters than $ can be used, -but we will stick to dollar signs here.) -Until you do this, $ signs have no special -significance to neqn. - -Modify the file "Example" by adding the "delim" -lines to the beginning, and check that $ signs are -now significant. Type "ready" when you are done. -#once #create Ref -.EQ -delim $$ -.EN -.LP -Now is the $times$ for all good $mu$ $epsilon$ $nu$ -to come to the aid of their party. -.pl 1 -#once #create Example -.LP -Now is the $times$ for all good $mu$ $epsilon$ $nu$ -to come to the aid of their party. -.pl 1 -#user -#cmp Ref example -#log -#next -6.1c 10 diff --git a/usr.bin/learn/lib/eqn/L6.1c b/usr.bin/learn/lib/eqn/L6.1c deleted file mode 100644 index bebfcb45e59..00000000000 --- a/usr.bin/learn/lib/eqn/L6.1c +++ /dev/null @@ -1,27 +0,0 @@ -#print -One thing to keep in mind is that outside of -$ signs, spaces are significant just as they -were before. Inside $ signs, spaces are significant -only as delimiters, and will not add any space -to the output. -Furthermore, inside delimiters, new lines also -don't matter, just as they didn't matter between -the .EQ and .EN. - -Do the lines - -Let $alpha$ be the size of the vector $pi$. - -and - -Let $ alpha $ be the size of the vector $ pi $. - -produce the same output? -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -6.1d 10 diff --git a/usr.bin/learn/lib/eqn/L6.1d b/usr.bin/learn/lib/eqn/L6.1d deleted file mode 100644 index 2552ccd4e96..00000000000 --- a/usr.bin/learn/lib/eqn/L6.1d +++ /dev/null @@ -1,18 +0,0 @@ -#print -Do the inputs - -Let $x sub i$ and $y sub i$ be $>= z sub i$. - -and - -Let $x sub i$ and $y sub i$ be $>=$ $z sub i$. - -produce the same output? -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -7.1a diff --git a/usr.bin/learn/lib/eqn/L7.1a b/usr.bin/learn/lib/eqn/L7.1a deleted file mode 100644 index f41f56bf9fb..00000000000 --- a/usr.bin/learn/lib/eqn/L7.1a +++ /dev/null @@ -1,48 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -The next construction we're going to look at -is one for putting things above and below other -things, in a rather specialized way. -For example, if you want something like -.EQ -sum from i to j -.EN -you type - .EQ - sum from i to j - .EN -The words "from" and "to" are more magic, like -sub or sup or over. The "from" part is centered -under the main piece; the "to" part is centered -above it. -As a warmup, modify "Example" so it produces -output that looks like the following, then type -ready. -.pl 1 -#once #create Ref -.EQ -delim $$ -.EN -.LP -Let $Q( pi )$ be $sum from {i= pi sub 1} to {i= pi sub 2} x sub i$. -.pl 1 -#once #create Example -.EQ -delim $$ -.EN -.LP -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -7.1b 10 diff --git a/usr.bin/learn/lib/eqn/L7.1b b/usr.bin/learn/lib/eqn/L7.1b deleted file mode 100644 index d9ece995fa3..00000000000 --- a/usr.bin/learn/lib/eqn/L7.1b +++ /dev/null @@ -1,50 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -As you might expect from our previous discussions, -any part of a - - thing from thing to thing - -construction can be as complicated as you wish. -The only limitation is that the individual "thing"'s -may well need braces around them to make it -clear to neqn which part goes with which. - -For example, suppose you want -.EQ -sum from {pi = 0} to {pi = n} -.EN -Then you have to ensure that the $pi =0$ and -$pi =n$ parts are included in braces or -they will not work right. - -Modify file "Example" so the output looks like -the example above, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -sum from {pi = 0} to {pi =n} -.EN -.pl 1 -#once #create Example -.LP -.EQ -sum from pi = 0 to pi = n -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -7.1c 10 -7.2b 5 diff --git a/usr.bin/learn/lib/eqn/L7.1c b/usr.bin/learn/lib/eqn/L7.1c deleted file mode 100644 index 0d20a68c23e..00000000000 --- a/usr.bin/learn/lib/eqn/L7.1c +++ /dev/null @@ -1,35 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -It is also quite permissible to leave out -either the "from" part or the "to" part -of a from-to construction. For example, -modify "Example" so its output looks like this, -then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -lim from {x-> pi /2} ( tan~x) sup {sin~2x}~=~1 -.EN -.pl 1 -#once #create Example -.LP -.EQ -lim from xxx ( tan~x) sup {sin~2x}~=~1 -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -7.1d 10 -7.2c 5 diff --git a/usr.bin/learn/lib/eqn/L7.1d b/usr.bin/learn/lib/eqn/L7.1d deleted file mode 100644 index 72eb0c49b9b..00000000000 --- a/usr.bin/learn/lib/eqn/L7.1d +++ /dev/null @@ -1,37 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -Let's do one more example of from-to for practice -before we go on to the next topic. -Modify "Example" so it produces output that looks -like this, then type "ready". -.pl 1 -#once #create Ref -.EQ -delim $$ -.EN -.LP -Let $Q( pi )$ be $sum from {i= pi sub 1} to {i= pi sub 2} x sub i$. -.pl 1 -#once #create Example -.EQ -delim $$ -.EN -.LP -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#fail -Don't forget to set delimiters before the .LP line, -and get the spaces right around the dollar signs. -#log -#next -8.1a 10 diff --git a/usr.bin/learn/lib/eqn/L7.2b b/usr.bin/learn/lib/eqn/L7.2b deleted file mode 100644 index 281237b0656..00000000000 --- a/usr.bin/learn/lib/eqn/L7.2b +++ /dev/null @@ -1,17 +0,0 @@ -#print -Does the input - - sum from {i = -n} to {i = +n} - -produce the same output as the input - - sum from i=-n to i=+n - -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -7.1c diff --git a/usr.bin/learn/lib/eqn/L7.2c b/usr.bin/learn/lib/eqn/L7.2c deleted file mode 100644 index 5bb518fb2c6..00000000000 --- a/usr.bin/learn/lib/eqn/L7.2c +++ /dev/null @@ -1,30 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -Modify file "Example" so it looks like this, -then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -sum to N+n-m x sub mn > 0 -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxx -.EN -.pl 1 -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -7.1d 10 diff --git a/usr.bin/learn/lib/eqn/L8.1a b/usr.bin/learn/lib/eqn/L8.1a deleted file mode 100644 index 06caba47f10..00000000000 --- a/usr.bin/learn/lib/eqn/L8.1a +++ /dev/null @@ -1,49 +0,0 @@ -#once #create message -.ND -.LP -The next neqn operation is called "sqrt" - it makes -square root signs over things, like this: -.EQ -sqrt a+b -.EN -(They don't look very good on a terminal, unfortunately.) -This one is very easy - to print the line above, you -say - .EQ - sqrt a+b - .EN -The "sqrt" operates on the first thing it finds -so if you want something more complicated, like -.EQ -sqrt {pi +1} -.EN -you have to use braces to enclose the entire -thing. This one was printed with - .EQ - sqrt {pi +1} - .EN -And that's all there is to sqrt. - -Modify "Example" so it looks like this, then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -f(x) ~=~ sqrt {ax sup 2 +bx+c} -.EN -.pl 1 -#once #create Example -.LP -.EQ -f(x).... -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -8.1b 10 diff --git a/usr.bin/learn/lib/eqn/L8.1b b/usr.bin/learn/lib/eqn/L8.1b deleted file mode 100644 index d6bf449a173..00000000000 --- a/usr.bin/learn/lib/eqn/L8.1b +++ /dev/null @@ -1,34 +0,0 @@ -#once #create message -.ND -.LP -Since "sqrt thing" is really a single object, you -often don't need braces around it, although there -may well be braces around "thing" itself. -For example, you can say - .EQ - 1 over sqrt {ax sup2 +bx+c} - .EN -to produce -.EQ -1 over sqrt {ax sup 2 +bx+c} -.EN -Does the input - .EQ - e sup sqrt {pi x} - .EN -produce the same output as - .EQ - e sup {sqrt {pi x}} - .EN -Answer yes or no. -.pl 1 -# -#once neqn message | nroff -T$term %s/tinyms - -#copyin -#user -#uncopyin -#match yes -#log -#next -9.1a 10 -8.2b 5 diff --git a/usr.bin/learn/lib/eqn/L8.2b b/usr.bin/learn/lib/eqn/L8.2b deleted file mode 100644 index c4c74784bf6..00000000000 --- a/usr.bin/learn/lib/eqn/L8.2b +++ /dev/null @@ -1,17 +0,0 @@ -#print -Does the input - .EQ - e sup sqrt {pi x} - .EN -produce the same output as - .EQ - e sup sqrt pi x - .EN -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -9.1a 10 diff --git a/usr.bin/learn/lib/eqn/L9.1a b/usr.bin/learn/lib/eqn/L9.1a deleted file mode 100644 index 4a07a8f828e..00000000000 --- a/usr.bin/learn/lib/eqn/L9.1a +++ /dev/null @@ -1,66 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -The next step is to learn about "diacriticals", which -is a big word for funny marks on symbols, like -a bar over something ($x bar$), or a tilde or hat on -something ($x tilde ,~a hat$), or perhaps a dot -or dotdot ($T dot ,~U dotdot$), or even an -underlining like $abc under$. - -These are all easy. Each funny character -has a name, and all you have to do is put the name -after the thing you want the character on. -Thus - x hat makes $x hat$ - y bar makes $y bar$ - T dot makes $T dot$ - x tilde makes $x tilde$ (notice that we spell tilde) - u dotdot makes $u dotdot$ (looks ugly on a terminal) -.br -and - i under makes $i under$. - -Except for "bar" and "under", these are almost always -attached to just a single letter. -If you want to put a bar over something longer, like -${2 pi +1} bar$, simply enclose the thing in braces: - - {2 pi +1} bar - -Modify "Example" to produce output that looks like this, -then type "ready". -.pl 1 -#once #create Ref -.EQ -delim $$ -.EN -.LP -Let $x bar$, $y bar$, and $z bar$ be the components of $pi bar$. -Let ${alpha +1} bar$ be the mean value of $alpha hat$. -.pl 1 -#once #create Example -.EQ -delim $$ -.EN -.LP -Let x bar, y bar, and z bar be the components of pi bar. -Let alpha +1 bar be the mean value of alpha hat. -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#fail -Don't forget to set delimiters at the beginning, -and get the spaces right around the dollar signs. -#log -#next -9.1b 10 -9.2a 5 diff --git a/usr.bin/learn/lib/eqn/L9.1b b/usr.bin/learn/lib/eqn/L9.1b deleted file mode 100644 index 32ef65cf3f1..00000000000 --- a/usr.bin/learn/lib/eqn/L9.1b +++ /dev/null @@ -1,48 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -You sometimes have to make explicit what you -mean when you say "bar", by putting in braces -to enclose the parts that you want the bar -to be over. -For example, what has to be done to make -the output -.EQ -{x sub i} bar -.EN -Find out (by putting braces in the right place -if necessary) in the file "Example", then -type "ready" after you have successfully modified it. -.pl 1 -#once #create Ref -.EQ -delim $$ -.EN -.LP -.EQ -{x sub i} bar -.EN -.pl 1 -#once #create Example -.EQ -delim $$ -.EN -.LP -.EQ -x sub i bar -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -10.1a 10 -9.2b 5 diff --git a/usr.bin/learn/lib/eqn/L9.2a b/usr.bin/learn/lib/eqn/L9.2a deleted file mode 100644 index 8d1e6cd111f..00000000000 --- a/usr.bin/learn/lib/eqn/L9.2a +++ /dev/null @@ -1,31 +0,0 @@ -#once #create message -.ND -.tr %$ -.EQ -delim $$ -.EN -.LP -Modify "Example" to produce output that looks like this, -then type "ready". -.pl 1 -#once #create Ref -.LP -.EQ -x bar ~=~ E(x) bar ~/~ E( x bar ) -.EN -.pl 1 -#once #create Example -.LP -.EQ -xxxx -.EN -.pl 1 -# -#once neqn Ref | nroff >X1 & -#once neqn message Ref | nroff -T$term %s/tinyms - -#user -neqn Example | nroff >X2 -#cmp X1 X2 -#log -#next -9.1b 10 diff --git a/usr.bin/learn/lib/eqn/L9.2b b/usr.bin/learn/lib/eqn/L9.2b deleted file mode 100644 index 521f27d18bb..00000000000 --- a/usr.bin/learn/lib/eqn/L9.2b +++ /dev/null @@ -1,20 +0,0 @@ -#print -Which equation prints a longer bar? - - xyz sub i bar - -or - - x yz sub i bar - -Type "answer N", where N is 1 if it's -the first one, 2 if it's the second, and -0 if they are the same length. -#copyin -#user -#uncopyin -#match 0 -#log -#next -10.1a 10 -9.3b 5 diff --git a/usr.bin/learn/lib/eqn/L9.3b b/usr.bin/learn/lib/eqn/L9.3b deleted file mode 100644 index a7a3029faaf..00000000000 --- a/usr.bin/learn/lib/eqn/L9.3b +++ /dev/null @@ -1,13 +0,0 @@ -#print -Does - ax bar -produce the same output as - a x bar -Answer yes or no. -#copyin -#user -#uncopyin -#match no -#log -#next -10.1a 10 diff --git a/usr.bin/learn/lib/eqn/tinyms b/usr.bin/learn/lib/eqn/tinyms deleted file mode 100644 index 676465f13a3..00000000000 --- a/usr.bin/learn/lib/eqn/tinyms +++ /dev/null @@ -1,24 +0,0 @@ -.\" short set of macros to simulate behavior of -.\" most common -ms macros: -.\" .PP, .LP, .EQ, .EN -.\" -.de PP -.br -.sp -.ll 60n -.fi -.ti +5n -.. -.de LP -.br -.sp -.ll 60n -.fi -.. -.de EQ -.sp -.ce -.. -.de EN -.sp -.. diff --git a/usr.bin/learn/lib/files/CHANGELOG b/usr.bin/learn/lib/files/CHANGELOG deleted file mode 100644 index 6747934811a..00000000000 --- a/usr.bin/learn/lib/files/CHANGELOG +++ /dev/null @@ -1,3 +0,0 @@ -Fri Sep 25 19:31:00 MDT 1998 ian -Split L0.1a into two so each fits in a normal 24x80 xterm. -Removed @ and #, replacing with geneirc ERASE and KILL. diff --git a/usr.bin/learn/lib/files/L0 b/usr.bin/learn/lib/files/L0 deleted file mode 100644 index bab7601e708..00000000000 --- a/usr.bin/learn/lib/files/L0 +++ /dev/null @@ -1,2 +0,0 @@ -#next -0.1a 10 diff --git a/usr.bin/learn/lib/files/L0.1a b/usr.bin/learn/lib/files/L0.1a deleted file mode 100644 index 604931d8ecb..00000000000 --- a/usr.bin/learn/lib/files/L0.1a +++ /dev/null @@ -1,23 +0,0 @@ -$ more L0.1a -#print -WARNING: This course was written for UNIX in 1979, not 1999, -and has not yet been fully updated. Some details may be way out of date! - -This course will help you learn about basic file -handling commands. You should first understand -the special characters ERASE and KILL: - ERASE cancels the previous character typed; - KILL cancels the line being typed. -ERASE and KILL are mapped to two non-text keyboard characters. -ERASE is usually one of CTRL/H (which means hold down the CTRL or -Control key WHILE you type the letter H) or the DEL (Delete) key. -KILL is mapped to some character like CTRL/U. - -Type the stty command at the prompt. Examine its output. -Type "ready" (without the quotes) when you've finished. -#copyin -#user -#uncopyin -#log -#next -0.1aa 5 diff --git a/usr.bin/learn/lib/files/L0.1aa b/usr.bin/learn/lib/files/L0.1aa deleted file mode 100644 index f52d54d92b7..00000000000 --- a/usr.bin/learn/lib/files/L0.1aa +++ /dev/null @@ -1,32 +0,0 @@ -#print -We just saw how to use "stty" to show the ERASE and KILL characters. -If you make a typing mistake, you can use these characters to -correct it before you finish the line and the computer won't -ever know about it. For example, what will the -computer really receive if you type - -st<ERASE>he<KILL> -thf<ERASE>e - -at it? Reply "answer WORD" where WORD is the word -as it will be interpreted. For example, if -you think it will get 'dog', type - -answer dog - -If you think it will receive the word "bark", type - -answer bark - -Don't forget to leave a space between "answer" and the word -and to hit RETURN at the end of the line. -Don't use any quotation marks in your answer. -#copyin -#user -#uncopyin -#match the -#bad answerthe -Leave a space between "answer" and "the". -#log -#next -0.1b 5 diff --git a/usr.bin/learn/lib/files/L0.1b b/usr.bin/learn/lib/files/L0.1b deleted file mode 100644 index 14c0b30eb88..00000000000 --- a/usr.bin/learn/lib/files/L0.1b +++ /dev/null @@ -1,28 +0,0 @@ -#print -You should also understand a few simple commands. -When UNIX types a "$" at you, you can type a command. -For example, if you type "date" the computer will tell -you the current date and time. If you see "$" and type "who", -UNIX will tell you who is logged on at present. There are -many other commands, too. You must type a RETURN at the -end of each command line. - -Try the "date" command now: find out what -date it is, and after the computer has responded, type "ready". -And don't forget the RETURN! -#copyin -#user -#uncopyin -grep date .copy >/dev/null -#bad day -You were supposed to type "date" (without quotes). -The computer is very intolerant of spelling errors. -Try again. -#bad "date" -Don't type those quote marks. Try again. -#bad time -The time command does not tell you the wall-clock time. -Try date next time. -#log -#next -0.1c 5 diff --git a/usr.bin/learn/lib/files/L0.1c b/usr.bin/learn/lib/files/L0.1c deleted file mode 100644 index 938f51e18ac..00000000000 --- a/usr.bin/learn/lib/files/L0.1c +++ /dev/null @@ -1,27 +0,0 @@ -#print -The computer keeps track of information in "files." -A file might contain a letter to a friend, -or a memo (or part of it) that you are typing, -or any number of other things. -You can list the names of your files -by typing the command "ls". -Try "ls" now; then type "ready". -Remember that each command must go on a separate line -and each line must be ended with RETURN. -#create letter -Dear John: - -I'm terribly sorry... -#create memo -This is a memo. -#create memo1 -Another memo. -#copyin -#user -#uncopyin -grep '^ls' .copy >/dev/null -#bad "ls" -Don't type the quotes, please. Try again. -#log -#next -0.1d 10 diff --git a/usr.bin/learn/lib/files/L0.1d b/usr.bin/learn/lib/files/L0.1d deleted file mode 100644 index a9e48d31912..00000000000 --- a/usr.bin/learn/lib/files/L0.1d +++ /dev/null @@ -1,30 +0,0 @@ -#print -File names are essentially arbitrary, -although usually one names files sensibly: -the files that make up a memo -might be called "memo1", "memo2", etc. - -The contents of a file are also entirely up to you: -for example, a file named "memo" could contain - - Analysis of Irregular Statistics - John B. Pencilpusher - - Bell Laboratories, Murray Hill, NJ - .... - -To get at the information in a file, -you have to use the file name, -which in this case is "memo". - -Is there a difference between the name of a file -and the contents of a file? -Type "yes" or "no". -#copyin -#user -#uncopyin -#match yes -#log -#next -1.1a 10 -1.2a 5 diff --git a/usr.bin/learn/lib/files/L1.1a b/usr.bin/learn/lib/files/L1.1a deleted file mode 100644 index 26a5d9a199a..00000000000 --- a/usr.bin/learn/lib/files/L1.1a +++ /dev/null @@ -1,12 +0,0 @@ -#print -The "ls" command will list the names of the files -in your directory. Is there a file named "junk" -present? Find out and then type "yes" or "no". -#copyin -#user -#uncopyin -#match no -#log -#next -2.1a 10 -2.2a 5 diff --git a/usr.bin/learn/lib/files/L1.2a b/usr.bin/learn/lib/files/L1.2a deleted file mode 100644 index 93d258f0ee8..00000000000 --- a/usr.bin/learn/lib/files/L1.2a +++ /dev/null @@ -1,15 +0,0 @@ -#print -Use the "ls" command to determine if there is a file -named for a state in the current directory. -Find out and type "yes" or "no". -(Don't use the list you got earlier - I've changed things.) -#create texas -dallas, houston, etc. -#copyin -#user -#uncopyin -#match yes -#log -#next -2.1a 10 -2.2a 5 diff --git a/usr.bin/learn/lib/files/L1.2b b/usr.bin/learn/lib/files/L1.2b deleted file mode 100644 index f8017405282..00000000000 --- a/usr.bin/learn/lib/files/L1.2b +++ /dev/null @@ -1,25 +0,0 @@ -#print -You can use the "ls" command to find out how -many files you have in your directory. -How many files are there in the current -directory now? Make another list - the list of files -that you made before is no longer right because I added -some files to the directory. When you find out -how many files there are in this directory, type -"answer N" where N is the number of files. -#create a1 -file a1 -#create a2 -file a2 -#create X1 -file a1 -#copyin -#user -#uncopyin -ls | %s/../lcount >X1 -tail -1 .copy >X2 -#cmp X1 X2 -#log -#next -2.1a 10 -2.2a 5 diff --git a/usr.bin/learn/lib/files/L10.1a b/usr.bin/learn/lib/files/L10.1a deleted file mode 100644 index a7eeec79bcc..00000000000 --- a/usr.bin/learn/lib/files/L10.1a +++ /dev/null @@ -1,21 +0,0 @@ -#print -When you are done with something, you will want to know -how to get rid of the file it is on. The command -for that is "rm" (remove). For example - rm junk -throws away the file named "junk". Once it -is gone, it is really gone - there is no way -to "undo" a remove command. Hence this command -should be used with caution. -In this directory there is one file named -for a baseball player. Remove it. -Then type "ready". -#create kernighan -#create yastrzemski -#user -test ! -r yastrzemski && test -r kernighan -#log -#next -11.1a 10 -11.2a 5 -11.3a 2 diff --git a/usr.bin/learn/lib/files/L10.2a b/usr.bin/learn/lib/files/L10.2a deleted file mode 100644 index e76c627aa58..00000000000 --- a/usr.bin/learn/lib/files/L10.2a +++ /dev/null @@ -1,15 +0,0 @@ -#print -The way to get rid of a file you are finished with -is with the "rm" (remove) command. For example, - rm junk -will get rid of the file named "junk". -In this directory there is a file named "harry" - -remove it. -Then type "ready". -#create harry -#user -test ! -r harry -#log -#next -10.2b 5 -10.3a 2 diff --git a/usr.bin/learn/lib/files/L10.2b b/usr.bin/learn/lib/files/L10.2b deleted file mode 100644 index 08af6c043e6..00000000000 --- a/usr.bin/learn/lib/files/L10.2b +++ /dev/null @@ -1,18 +0,0 @@ -#print -You can remove several files at once with the "rm" command. -And you can use the familiar "*" and "?" characters -to abbreviate several file names. BUT BE CAREFUL - -"rm" is irreversible, and it is all too easy to type something -like "rm *" and get rid of all your files. -In this directory are two files named -"part1" and "part2". -Remove both; then type "ready". -#create part1 -#create part2 -#user -test ! -r part1 && test ! -r part2 -#log -#next -11.1a 10 -11.2a 5 -11.3a 2 diff --git a/usr.bin/learn/lib/files/L10.3a b/usr.bin/learn/lib/files/L10.3a deleted file mode 100644 index b443cad71dc..00000000000 --- a/usr.bin/learn/lib/files/L10.3a +++ /dev/null @@ -1,15 +0,0 @@ -#print -When you are done with something, you will want to -get rid of the file containing it. The command for that -is "rm" (remove). For example - rm junk -throws away the file named "junk". Try that - -there's a file named "junk" in this directory, as you can -verify by doing an "ls". Try another "ls" after the "rm junk"; -then type "ready". -#create junk -#user -test ! -r junk -#log -#next -10.3b 2 diff --git a/usr.bin/learn/lib/files/L10.3b b/usr.bin/learn/lib/files/L10.3b deleted file mode 100644 index 516b558e34c..00000000000 --- a/usr.bin/learn/lib/files/L10.3b +++ /dev/null @@ -1,12 +0,0 @@ -#print -Often you will use "ls" with "rm" -to first find the name of a file, and then remove it. -This directory contains one file whose name begins with "g". -Find out what it is and remove it. -Then type "ready". -#create george -#user -test ! -r george -#log -#next -10.3c 2 diff --git a/usr.bin/learn/lib/files/L10.3c b/usr.bin/learn/lib/files/L10.3c deleted file mode 100644 index 6d5c108ce06..00000000000 --- a/usr.bin/learn/lib/files/L10.3c +++ /dev/null @@ -1,15 +0,0 @@ -#print -You can remove several files at once with the -"rm" command; for example, - rm tom dick harry -will remove the files "tom", "dick", and "harry". -There are two files in this directory named -for birds: get rid of both. -Then type "ready". -#create eagle -#create bluejay -#user -test ! -r eagle && test ! -r bluejay -#log -#next -10.3d 2 diff --git a/usr.bin/learn/lib/files/L10.3d b/usr.bin/learn/lib/files/L10.3d deleted file mode 100644 index 4b68bea357e..00000000000 --- a/usr.bin/learn/lib/files/L10.3d +++ /dev/null @@ -1,23 +0,0 @@ -#print -You can also use "*" and "?" with -the "rm" command. BUT BE VERY CAREFUL -since, for example, "rm *" will throw away -ALL the files in a directory. -In this directory are some files named -chunk1, chunk2, chunk3 and chunk4. -Get rid of them. Then type "ready". -#create X1 -# -ls >X2 -#create chunk1 -#create chunk2 -#create chunk3 -#create chunk4 -#user -ls >X1 -#cmp X1 X2 -#log -#next -11.1a 10 -11.2a 5 -11.3a 2 diff --git a/usr.bin/learn/lib/files/L11.1a b/usr.bin/learn/lib/files/L11.1a deleted file mode 100644 index 47e4e53a7fb..00000000000 --- a/usr.bin/learn/lib/files/L11.1a +++ /dev/null @@ -1,42 +0,0 @@ -#print -To create a second copy of a file, the easiest -way is to use the "cp" (copy) command. -If you tell the computer - cp x y -a copy of file "x" is made and named "y". -Note that this is similar to "mv" in that a new -file named "y" appears, but the difference is -that the old file is not removed. -(If there was already a file named "y", though, the -old contents are lost; be careful.) - -In this directory there is a file which has -a five letter name whose first four letters -are "part". -Print it out; it will tell you to copy -it and what to call the copy. -Do that and then type "ready". -#create X1 -#create george -#create part00 -this is not the right file and you shouldn't -have printed it. Use - part? -not - part* -in this example. -#create part3 -This is the file "part3". I hope you -used a command like - ls part? -or - cat part? -to find it. -Make a copy of this file on file "george". -#user -#cmp george part3 -#log -#next -12.1a 10 -12.2a 5 -12.3a 2 diff --git a/usr.bin/learn/lib/files/L11.2a b/usr.bin/learn/lib/files/L11.2a deleted file mode 100644 index 7c397e7746e..00000000000 --- a/usr.bin/learn/lib/files/L11.2a +++ /dev/null @@ -1,16 +0,0 @@ -#print -To make a new copy of a file, the easiest -way is to use the "cp" command. -If you type - cp x y -a copy of file "x" is made and named "y". -This directory contains a file named "george"; -make a copy named "steve". -Then type "ready". -#create george -this is file george -#user -#cmp steve george -#log -#next -11.2b 5 diff --git a/usr.bin/learn/lib/files/L11.2b b/usr.bin/learn/lib/files/L11.2b deleted file mode 100644 index f4154e99111..00000000000 --- a/usr.bin/learn/lib/files/L11.2b +++ /dev/null @@ -1,26 +0,0 @@ -#print -Contrast - cp old new -with - mv old new -as commands; both cause "new" to appear, -but "cp" does not remove "old". -Both, by the way, destroy anything -that happened to be around named "new". -There is a file in this directory -whose name ends in "x". Use "ls" -with the "*x" construction to find its name; -then copy it to file "new", and type "ready". -#create new -old new -#create pix -new new -#create xip -nothing -#user -#cmp pix new -#log -#next -12.1a 10 -12.2a 5 -12.3a 2 diff --git a/usr.bin/learn/lib/files/L11.3a b/usr.bin/learn/lib/files/L11.3a deleted file mode 100644 index e019f83a078..00000000000 --- a/usr.bin/learn/lib/files/L11.3a +++ /dev/null @@ -1,17 +0,0 @@ -#print -To make a copy of a file, you can use the -"cp" (copy) command. For example - cp old new -will make a copy of file "old", named "new". -This directory contains a file named "old"; -try the "cp" command to make a file named "new". -Print the file to check on the copy. -When done, type "ready". -#create old -The Brooklyn Museum is at 188 Eastern Parkway, -Brooklyn, NY 11238. -#user -#cmp old new -#log -#next -11.3b 2 diff --git a/usr.bin/learn/lib/files/L11.3b b/usr.bin/learn/lib/files/L11.3b deleted file mode 100644 index 9b3b47b481d..00000000000 --- a/usr.bin/learn/lib/files/L11.3b +++ /dev/null @@ -1,13 +0,0 @@ -#print -Now there is a file named "good" -in this directory. Make a copy named "better", -then type ready. -#create good -This file has -three lines -in it. -#user -#cmp good better -#log -#next -11.3c 2 diff --git a/usr.bin/learn/lib/files/L11.3c b/usr.bin/learn/lib/files/L11.3c deleted file mode 100644 index a76c5515ae0..00000000000 --- a/usr.bin/learn/lib/files/L11.3c +++ /dev/null @@ -1,22 +0,0 @@ -#print -This is a little trickier. The directions -for this step are in a file whose -name begins with "p". Print that file; -it will tell you what to do. Then type "ready". -#create delaware -narrowsburg -port jervis -delaware water gap -easton -trenton -philadelphia -#create pub -Make a copy of the file "delaware" which is -named "hudson". -#user -#cmp delaware hudson -#log -#next -12.1a 10 -12.2a 5 -12.3a 2 diff --git a/usr.bin/learn/lib/files/L12.1a b/usr.bin/learn/lib/files/L12.1a deleted file mode 100644 index 5cd4f7c3d54..00000000000 --- a/usr.bin/learn/lib/files/L12.1a +++ /dev/null @@ -1,42 +0,0 @@ -#print -Another very useful command is the command - diff x y -which compares two files. It will not print -any output if the two files are the same, but -if the files are different it will print -out the lines that are changed in the two files, -indicating the lines from the first file (x) by a leading "<" -and the lines from the second file (y) by a leading ">". -There are two files in this directory named "old" and "new". -Why don't you first print both files, and then -try using "diff" to compare them? Suppose the files -were hundreds of lines long, and you needed to know -the single difference - do you see how valuable "diff" can be? -As evidence that you did at least half of this, -type "answer word" where "word" is the word added to the -second file. -#create new -Four score and seven -years ago our fathers -brought forth on this -continent a new nation, -conceived in liberty -and dedicated to the -proposition that all -men are created equal. -#create old -Four score and seven -years ago our fathers -brought forth on this -continent a new nation, -conceived in liberty -and dedicated the -proposition that all -men are created equal. -#copyin -#user -#uncopyin -#match to -#log -#next -13.1a diff --git a/usr.bin/learn/lib/files/L12.2a b/usr.bin/learn/lib/files/L12.2a deleted file mode 100644 index 79ee4e19055..00000000000 --- a/usr.bin/learn/lib/files/L12.2a +++ /dev/null @@ -1,25 +0,0 @@ -#print -To compare two files, you can use the command -"diff" (differences); the line - diff xx yy -will compare the files xx and yy and tell you about -any differences between them. If the files are the same, -the command says nothing. Are the files -"tom" and "dick" the same in this directory? -Find out (print them if you feel insecure) -and reply "yes" or "no". -#create dick -This stuff is not only in -file tom but also -in file dick -#create tom -This stuff is not only in -file tom but also -in file dick -#copyin -#user -#uncopyin -#match yes -#log -#next -12.2b 5 diff --git a/usr.bin/learn/lib/files/L12.2b b/usr.bin/learn/lib/files/L12.2b deleted file mode 100644 index bb462a83481..00000000000 --- a/usr.bin/learn/lib/files/L12.2b +++ /dev/null @@ -1,27 +0,0 @@ -#print -Now are the files "dick" and "harry" the same? -Again reply "yes" or "no". -If there are differences between files, "diff" prints -the lines that are different, indicating those -from the first file by "<" and those from -the second file by ">". -#create dick -new york -bridgeport -new haven -new london -providence -boston -#create harry -new york -bridgeport -new haven -providence -boston -#copyin -#user -#uncopyin -#match no -#log -#next -12.2c 5 diff --git a/usr.bin/learn/lib/files/L12.2c b/usr.bin/learn/lib/files/L12.2c deleted file mode 100644 index e3870bd1307..00000000000 --- a/usr.bin/learn/lib/files/L12.2c +++ /dev/null @@ -1,29 +0,0 @@ -#print -This directory contains two files named "old" and "new"; -What word is in one file but not the other? Find -out. Reply "answer WORD" where WORD is that word. -#create new -Four score and seven -years ago our fathers -brought forth on this -continent a new nation, -conceived in liberty -and dedicated to the -proposition that all -men are created equal. -#create old -Four score and seven -years ago our fathers -brought forth on this -continent a new nation, -conceived in liberty -and dedicated the -proposition that all -men are created equal. -#copyin -#user -#uncopyin -#match to -#log -#next -13.1a diff --git a/usr.bin/learn/lib/files/L12.3a b/usr.bin/learn/lib/files/L12.3a deleted file mode 100644 index 4ebd5920669..00000000000 --- a/usr.bin/learn/lib/files/L12.3a +++ /dev/null @@ -1,21 +0,0 @@ -#print -A very useful command is the command - diff x y -which compares the two files x and y and tells -you any differences between the files. If the files -are the same, it says nothing. To test that, -copy file "george" onto file "harry"; -then say - diff george harry -to verify that the files are the same. -#create george -london bridge -is falling down. -#copyin -#user -#uncopyin -#match diff george harry -#match diff harry george -#log -#next -12.3b 2 diff --git a/usr.bin/learn/lib/files/L12.3b b/usr.bin/learn/lib/files/L12.3b deleted file mode 100644 index 536b593b9f4..00000000000 --- a/usr.bin/learn/lib/files/L12.3b +++ /dev/null @@ -1,18 +0,0 @@ -#print -Are the files "memo1" and "memo2" the same? -If they are different, "diff" will print the -lines that are not the same. -Reply "yes" or "no". -#create memo1 -A quick brown fox jumps over the lazy dog. -We were away a year ago. -#create memo2 -A quick brown fox jumps over the lazy dog. -We were away a year ago. -#copyin -#user -#uncopyin -#match yes -#log -#next -12.3c 2 diff --git a/usr.bin/learn/lib/files/L12.3c b/usr.bin/learn/lib/files/L12.3c deleted file mode 100644 index e8afedebe79..00000000000 --- a/usr.bin/learn/lib/files/L12.3c +++ /dev/null @@ -1,22 +0,0 @@ -#print -Are the files "old" and "new" in this directory the same? -Again, if they are not, "diff" will print out the differences -marking the lines in the first file named by "<" and the -lines in the second file by ">". Check the results of -diff by printing the files. Then type "yes" or "no". -#create new -This file has three -lines of text in -it to read. -and this has one more. -#create old -This file has three -lines of text in -it to read. -#copyin -#user -#uncopyin -#match no -#log -#next -12.2c 5 diff --git a/usr.bin/learn/lib/files/L13.1a b/usr.bin/learn/lib/files/L13.1a deleted file mode 100644 index 2887447aa85..00000000000 --- a/usr.bin/learn/lib/files/L13.1a +++ /dev/null @@ -1,16 +0,0 @@ -#print -Let's do a quick review of the things covered -in the files course. To begin, how many files -are there in the current directory? Type "answer N", -where N is the number that you found. -#create X1 -#create X2 -#copyin -#user -#uncopyin -ls | %s/../lcount >X1 -tail -1 .copy >X2 -#cmp X1 X2 -#log -#next -13.1b 5 diff --git a/usr.bin/learn/lib/files/L13.1b b/usr.bin/learn/lib/files/L13.1b deleted file mode 100644 index 1161cc9111e..00000000000 --- a/usr.bin/learn/lib/files/L13.1b +++ /dev/null @@ -1,19 +0,0 @@ -#print -There is a file in this directory whose name begins -with 'z'. Do what it tells you to, then type "ready". -#create X1 -#create X2 -#create zip -Rename the file named "mary" to "joe". -#create joe -I am a file -# -rm -f mary -ls >X1 -mv joe mary -#user -ls >X2 -#cmp X1 X2 -#log -#next -13.1c 5 diff --git a/usr.bin/learn/lib/files/L13.1c b/usr.bin/learn/lib/files/L13.1c deleted file mode 100644 index 8a5edf3b203..00000000000 --- a/usr.bin/learn/lib/files/L13.1c +++ /dev/null @@ -1,24 +0,0 @@ -#print -There are two files in this directory whose names begin with -the letter 'r'. On what line do they differ? -Type "answer N", where N is the line number where they -first are different. -#create ref -This is a very short file -which contains several lines -some one of which will be changed -in the other version, and your -job is to find out which. -#create refnew -This is a very short file -which contains several lines -some one of which will be changed -in the other version, and your -job is to find out which. -#copyin -#user -#uncopyin -#match 3 -#log -#next -13.1d diff --git a/usr.bin/learn/lib/files/L13.1d b/usr.bin/learn/lib/files/L13.1d deleted file mode 100644 index dd55663dbd6..00000000000 --- a/usr.bin/learn/lib/files/L13.1d +++ /dev/null @@ -1,17 +0,0 @@ -#print -There are several files in this directory whose names -begin with "easy". Remove them, then type "ready". -#create X1 -#create X2 -# -ls >X2 -#create easy1 -#create easyer -#create easyrider -#create easyenough -#user -ls >X1 -#cmp X1 X2 -#log -#next -13.1e diff --git a/usr.bin/learn/lib/files/L13.1e b/usr.bin/learn/lib/files/L13.1e deleted file mode 100644 index 03b9b4c3210..00000000000 --- a/usr.bin/learn/lib/files/L13.1e +++ /dev/null @@ -1,16 +0,0 @@ -#print -This one is tougher than the last one. There are -several files in this directory whose names -begin with "hard". Remove them, then type "ready". -#create X1 -#create X2 -# -ls >X2 -cp X1 "hard 1" -cp X1 "hard er" -#user -ls >X1 -#cmp X1 X2 -#log -#next -13.1f diff --git a/usr.bin/learn/lib/files/L13.1f b/usr.bin/learn/lib/files/L13.1f deleted file mode 100644 index d164bc937f4..00000000000 --- a/usr.bin/learn/lib/files/L13.1f +++ /dev/null @@ -1,23 +0,0 @@ -#print -Suppose you have two files named "dick" and "jane", and you -want to interchange them, so that "dick" contains whatever -was originally in "jane", and "jane" contains what was in "dick". -Will this sequence of commands do the job? - -mv dick jane -mv jane dick - -There are two files named "john" and "mary" -in this directory, if you wish to experiment. -When you have decided, type yes or no. -#create john -this is originally file john -#create mary -this is originally file mary -#copyin -#user -#uncopyin -#match no -#log -#next -13.1g diff --git a/usr.bin/learn/lib/files/L13.1g b/usr.bin/learn/lib/files/L13.1g deleted file mode 100644 index 5c348bf332a..00000000000 --- a/usr.bin/learn/lib/files/L13.1g +++ /dev/null @@ -1,20 +0,0 @@ -#print -Suppose that we really do want to interchange the contents -of the files "dick" and "jane". One way to do it is -to move the contents of "dick" into some temporary file, -then move "jane" onto "dick" (which of course clobbers -the old contents of "dick", but we saved them already), -then finally to move the temporary copy of "dick" to -"jane". There are two files named "dick" and "jane" in this -directory. Interchange their contents, then type "ready". -#create Ref -short file for dick -#create dick -short file for dick -#create jane -another file for jane -#create Ref1 -another file for jane -#user -cmp -s jane Ref && cmp -s dick Ref1 -#log diff --git a/usr.bin/learn/lib/files/L2.1a b/usr.bin/learn/lib/files/L2.1a deleted file mode 100644 index 3d6a7a30ecf..00000000000 --- a/usr.bin/learn/lib/files/L2.1a +++ /dev/null @@ -1,21 +0,0 @@ -#print -The "mv" command changes the names of files. -For example, "mv bob bill" changes the name -of file "bob" to be "bill". If there was already -a file named "bill", the old version is destroyed. - -There is a file in -the current directory whose name begins with -the letter "g", like "grant" or "grover". -Find out what the file name really is, and -then change that file to have the name "john". -Then type "ready". -#create george -this should become john -#user -test -r john -#log -#next -3.1a 10 -3.2a 5 -3.3a 2 diff --git a/usr.bin/learn/lib/files/L2.2a b/usr.bin/learn/lib/files/L2.2a deleted file mode 100644 index b522ee08f7e..00000000000 --- a/usr.bin/learn/lib/files/L2.2a +++ /dev/null @@ -1,17 +0,0 @@ -#print -The "mv" command changes the names of files. -For example, "mv thomas james" changes the -name of the file "thomas" to be "james". - -There is a file in the current directory named -"thomas". Change that file to have the -name "james". Then type "ready". -(The "mv" command, by the way, is like many -UNIX commands in that it is silent unless there is an error.) -#create thomas -xx -#user -test -r james -#log -#next -2.2b 5 diff --git a/usr.bin/learn/lib/files/L2.2b b/usr.bin/learn/lib/files/L2.2b deleted file mode 100644 index e38143cea13..00000000000 --- a/usr.bin/learn/lib/files/L2.2b +++ /dev/null @@ -1,24 +0,0 @@ -#print -Now your directory contains a file with a name -that starts with "a" (like "adam", "arthur", etc.). -Find it and change its name to "martin". -Then type "ready". -By the way, if there was already a file around -named "martin", the old version is clobbered -by the new one. -#create andrew -stuff -#user -test -r martin -#fail -Do you remember that the "ls" command will -tell you the names of the files in the current -directory? Thus you can use "ls" to tell you -what your file names are; and then you can use -"mv" to change the name of the file -beginning with "a" to "martin". -#log -#next -3.1a 10 -3.2a 5 -3.3a 2 diff --git a/usr.bin/learn/lib/files/L3.1a b/usr.bin/learn/lib/files/L3.1a deleted file mode 100644 index dfaabeac84f..00000000000 --- a/usr.bin/learn/lib/files/L3.1a +++ /dev/null @@ -1,34 +0,0 @@ -#print -The "cat" command prints the contents of one or more files. -In fact, it is named "cat" as an abbreviation -for "concatenate". To print the files named "dog" -and "mouse" in succession, you could type either - cat dog - cat mouse -or just - cat dog mouse -If you print them with one command, -the contents are printed in sequence with nothing -between them. - -How many lines are there in all the files -whose names begin with "b"? Find out, then type -"answer N" where N is the total number of lines. -#create ben -the file ben has -a total of three -short lines. -#create bernie -this file has -two lines. -#create bruce -only one line here. -#copyin -#user -#uncopyin -#match 6 -#log -#next -4.1a 10 -4.2a 5 -4.3a 2 diff --git a/usr.bin/learn/lib/files/L3.2a b/usr.bin/learn/lib/files/L3.2a deleted file mode 100644 index 593f8cc98e9..00000000000 --- a/usr.bin/learn/lib/files/L3.2a +++ /dev/null @@ -1,23 +0,0 @@ -#print -The command "cat" will print files. For example, you -can print the file named "food" by typing "cat food". -Your current directory has a file named "sam" and a -file named "steve". Which is longer? Find out and -type "answer sam" or "answer steve", giving the name -of the longer file. -#create sam -this is the file sam. it contains -only two lines of text. -#create steve -this file is named steve. it is a -file which contains five lines of text. -this is of course a very short file -by any ordinary standards, although -on UNIX most files are rather short. -#copyin -#user -#uncopyin -#match steve -#log -#next -3.2b 5 diff --git a/usr.bin/learn/lib/files/L3.2b b/usr.bin/learn/lib/files/L3.2b deleted file mode 100644 index e99f3ba4f35..00000000000 --- a/usr.bin/learn/lib/files/L3.2b +++ /dev/null @@ -1,32 +0,0 @@ -#print -The "cat" command can also print several files -at once. In fact, it is named "cat" as an abbreviation -for "concatenate". To print the files named "dog" -and "mouse" in succession, you could either -type: - cat dog - cat mouse -or just - cat dog mouse -If you print them with one command, -the files are listed in sequence with nothing -between them. - -This directory contains two files -named "chester" and "charley". What is the -longest word in either file? Type "answer WORD" -where WORD is the longest word you find. -#create charley -most of this file is short but at one place -there is a surprisingly long word. -#create chester -and of the but here now stop go -#copyin -#user -#uncopyin -#match surprisingly -#log -#next -4.1a 10 -4.2a 5 -4.3a 2 diff --git a/usr.bin/learn/lib/files/L3.3a b/usr.bin/learn/lib/files/L3.3a deleted file mode 100644 index 1b082b22f9a..00000000000 --- a/usr.bin/learn/lib/files/L3.3a +++ /dev/null @@ -1,18 +0,0 @@ -#print -A file can be printed on your terminal -by using the "cat" command. Just say -"cat file" where "file" is the file name. -For example, there is a file named -"food" in this directory. List it -by saying "cat food"; then type "ready". -#create food - this is the file - named food. -#copyout -#user -#uncopyout -tail -2 .ocopy >X1 -#cmp X1 food -#log -#next -3.3b 2 diff --git a/usr.bin/learn/lib/files/L3.3b b/usr.bin/learn/lib/files/L3.3b deleted file mode 100644 index 525d4d2d90d..00000000000 --- a/usr.bin/learn/lib/files/L3.3b +++ /dev/null @@ -1,23 +0,0 @@ -#print -Of course, you can print any file with "cat". -In particular, it is common to first use -"ls" to find the name of a file and then "cat" -to print it. Note the difference between -"ls", which tells you the name of the files, -and "cat", which tells you the contents. - -One file in the current directory is named for -a President. Print the file, then type "ready". -#create roosevelt - this file is named roosevelt - and contains three lines of - text. -#copyout -#user -#uncopyout -cp .ocopy X2 -tail -3 .ocopy >X1 -#cmp X1 roosevelt -#log -#next -3.2b 2 diff --git a/usr.bin/learn/lib/files/L4.1a b/usr.bin/learn/lib/files/L4.1a deleted file mode 100644 index cbc3f2db660..00000000000 --- a/usr.bin/learn/lib/files/L4.1a +++ /dev/null @@ -1,17 +0,0 @@ -#print -The "ls" command may be given with one -or more file names. In that case, -it will tell which which of the files exist. -How many of the files "doug", "dave", and -"dennis" exist in this directory? Find out -and then type "answer N" where N is the number -you found. -#create dennis -#create doug -#copyin -#user -#uncopyin -#match 2 -#log -#next -5.1a 10 diff --git a/usr.bin/learn/lib/files/L4.2a b/usr.bin/learn/lib/files/L4.2a deleted file mode 100644 index 596ff43afa3..00000000000 --- a/usr.bin/learn/lib/files/L4.2a +++ /dev/null @@ -1,19 +0,0 @@ -#print -If a file name is given with the "ls" command, -it tells you whether that file exists. -The file name is listed if the file exists; -if it doesn't, a complaint is typed. -For example, - ls george -will type "george" if the file exists, -and "george not found" if it is missing. - -Is there a file named "alexander" in the -current directory? Find out, then type "yes" or "no". -#copyin -#user -#uncopyin -#match no -#log -#next -4.2b 10 diff --git a/usr.bin/learn/lib/files/L4.2b b/usr.bin/learn/lib/files/L4.2b deleted file mode 100644 index e0e97bcc343..00000000000 --- a/usr.bin/learn/lib/files/L4.2b +++ /dev/null @@ -1,21 +0,0 @@ -#print -You can inquire about several files at once -with the "ls" command. If you type, for example, - ls fee fi fo fum -you will be told which of the four files "fee", "fi", "fo", -and "fum" exist. In the current directory only one -of the files "grover", "gerald", or "george" exists. -Find out which one; then rename it "grant". -Type "ready" when you are done. -#create gerald -file -#create garbage -garbage it is. -#user -#create X1 -file -# -cmp -s X1 grant && test ! -r gerald -#log -#next -5.1a 10 diff --git a/usr.bin/learn/lib/files/L4.3a b/usr.bin/learn/lib/files/L4.3a deleted file mode 100644 index fa380b99d4d..00000000000 --- a/usr.bin/learn/lib/files/L4.3a +++ /dev/null @@ -1,20 +0,0 @@ -#print -You can use the "ls" command to ask whether -a single file exists without listing the entire -directory. For example, "ls george" will list -"george" if there is a file with that name, and -complain if there is not one. This directory -contains a file named "arthur" but no file named -"alan". You can verify that by typing the -ordinary "ls" command. Then try typing "ls arthur" -to see what happens, and follow that by "ls alan". -Then type "ready". -#create arthur -xxx -#copyin -#user -#uncopyin -grep 'ls arthur' .copy >/dev/null && grep 'ls alan' .copy >/dev/null -#log -#next -4.3b 0 diff --git a/usr.bin/learn/lib/files/L4.3b b/usr.bin/learn/lib/files/L4.3b deleted file mode 100644 index 3aec8729644..00000000000 --- a/usr.bin/learn/lib/files/L4.3b +++ /dev/null @@ -1,20 +0,0 @@ -#print -With the "ls" command, you can inquire about several -specific files at once. For example, in the previous -case, you could type - -ls arthur alan - -and be told about both files. - -Which one of the files "bruce" and "ben" exists? -Type "answer NAME", where NAME is the one you find. -#create bruce -bruce -#copyin -#user -#uncopyin -#match bruce -#log -#next -4.3c 2 diff --git a/usr.bin/learn/lib/files/L4.3c b/usr.bin/learn/lib/files/L4.3c deleted file mode 100644 index 11b9adedceb..00000000000 --- a/usr.bin/learn/lib/files/L4.3c +++ /dev/null @@ -1,16 +0,0 @@ -#print -Your directory contains only one of the following -files: "richard", "robert", "ralph", "roger". Find out -which one exists, and print the contents of that file -on your terminal (remember the "cat" command?). -Then type "ready". -#create robert -this is the contents of file -robert which you had to print. -#copyin -#user -#uncopyin -grep 'cat rob' .copy >/dev/null -#log -#next -5.1a 10 diff --git a/usr.bin/learn/lib/files/L5.1a b/usr.bin/learn/lib/files/L5.1a deleted file mode 100644 index 6e206f480fb..00000000000 --- a/usr.bin/learn/lib/files/L5.1a +++ /dev/null @@ -1,34 +0,0 @@ -#print -Most UNIX commands, like "ls" and "cat", let you -specify any number of file names after the command. -To make this as easy as possible, there are some -ways to abbreviate file names. This is usually -faster and more accurate than typing out the list in full. - -For example, when the character "?" is used in a file name, -it will represent any character that might be -in a file name. That is, the name "a?" is -an abbreviation for the files "a1", "a2", "aa", -and so forth. You can say - ls a? -and if there are any file names beginning with -"a" that are exactly two letters long, the computer -will tell you their names. Try that here. -First list all the file names with "ls"; then type - ls a? -to get all the two letter names beginning with "a". -Then type "ready". -#create a1 -#create a12 -#create abcdef -#create ax -#create aa -#copyin -#user -#uncopyin -grep '^ls a?$' .copy >/dev/null -#log -#next -5.1b 0 -5.1c 5 -5.1e 10 diff --git a/usr.bin/learn/lib/files/L5.1b b/usr.bin/learn/lib/files/L5.1b deleted file mode 100644 index 7f4b44c71ae..00000000000 --- a/usr.bin/learn/lib/files/L5.1b +++ /dev/null @@ -1,20 +0,0 @@ -#print -Will the name - xyz -be selected by the pattern - x? -in an "ls" command? -Type "yes" or "no". If you -have trouble, there is such a file -in the current directory, -so you can find out by trial and error. -(For example, you might do an ordinary "ls" -and then try "ls x?" and compare the results.) -#create xyz -#copyin -#user -#uncopyin -#match no -#log -#next -5.1c 0 diff --git a/usr.bin/learn/lib/files/L5.1c b/usr.bin/learn/lib/files/L5.1c deleted file mode 100644 index 39b88950421..00000000000 --- a/usr.bin/learn/lib/files/L5.1c +++ /dev/null @@ -1,26 +0,0 @@ -#print -The "?" may appear anywhere in the name. -For example you can type - a?bc -to match the list of names - axbc, aybc, a3bc -and so forth. -But the number of characters must always agree. -How many of the following file names -are matched by "x?xx"? - x1xx, y1xx, x1xxa, xxx -Type "answer N" where N is the number of matching names. -You can experiment in the current directory to -check your answer before typing it. -#create x1xx -#create x1xxa -#create y1xx -#create xxx -#copyin -#user -#uncopyin -#match 1 -#log -#next -5.1d 0 -5.1e 5 diff --git a/usr.bin/learn/lib/files/L5.1d b/usr.bin/learn/lib/files/L5.1d deleted file mode 100644 index 38ebe8449fa..00000000000 --- a/usr.bin/learn/lib/files/L5.1d +++ /dev/null @@ -1,14 +0,0 @@ -#print -Will the name - ?xx -match "axx"? Again, you may -experiment before typing your -answer. -#create axx -#copyin -#user -#uncopyin -#match yes -#log -#next -5.1e 0 diff --git a/usr.bin/learn/lib/files/L5.1e b/usr.bin/learn/lib/files/L5.1e deleted file mode 100644 index 03c4142b9cb..00000000000 --- a/usr.bin/learn/lib/files/L5.1e +++ /dev/null @@ -1,29 +0,0 @@ -#print -Not only may the ? appear anywhere in a name, -but there may be several ? characters in it. -For example, - g??rge -will match "george" and "goerge", among others. -And "a??" will match "abc" or "a11" (but NOT "ax"). -Look at the files in the current directory and decide -how many names the pattern - a?b?c -will select. Again, you can try this out -by comparing an ordinary "ls" with "ls a?b?c" -to see what happens. When you figure -out how many names are selected, -type "answer N" where N is the number of file names. -#create a0b0c -#create a0bc -#create a0x0c -#create a1bxc -#create aabbc -#create azbzcz -#copyin -#user -#uncopyin -#match 3 -#log -#next -6.1a 5 -6.2a 2 diff --git a/usr.bin/learn/lib/files/L6.1a b/usr.bin/learn/lib/files/L6.1a deleted file mode 100644 index 0eead332963..00000000000 --- a/usr.bin/learn/lib/files/L6.1a +++ /dev/null @@ -1,33 +0,0 @@ -#print -Since the "?" character only matches single characters, -it isn't useful for such questions as "how many files -have names beginning with g?" There is another character, - * -which can be used in patterns for file names, and which matches -any number of characters of any sort. Thus - g* -matches anything beginning with g. -And - *x -matches anything ending in x. -There is one file in this directory whose name ends -in "memo". Find out that file name -and print the contents of the file. Then type "ready". -#create mymemo -This is the 7-line file "mymemo"; you should -have typed "ls *memo", which would print -"mymemo", and then typed the -command "cat mymemo". -Or just plain "cat *memo" would have worked. -But whatever you did, you got it right -and now you can type "ready". -#copyout -#user -#uncopyout -tail -7 .ocopy >X2 -#cmp mymemo X2 -#log -#next -6.1b 0 -6.1c 5 -6.1e 10 diff --git a/usr.bin/learn/lib/files/L6.1b b/usr.bin/learn/lib/files/L6.1b deleted file mode 100644 index f7f0d01ea35..00000000000 --- a/usr.bin/learn/lib/files/L6.1b +++ /dev/null @@ -1,14 +0,0 @@ -#print -Will the file name "abcd" -be matched by "a*d"? Again, -if you are not sure, you can experiment -in this directory with commands like -"ls" and "ls a*d". -#create abcd -#copyin -#user -#uncopyin -#match yes -#log -#next -6.1c diff --git a/usr.bin/learn/lib/files/L6.1c b/usr.bin/learn/lib/files/L6.1c deleted file mode 100644 index bf8d88489c3..00000000000 --- a/usr.bin/learn/lib/files/L6.1c +++ /dev/null @@ -1,13 +0,0 @@ -#print -There is one file in this directory whose name begins -with "g". Rename it so the "g" at the beginning -of the name is replaced by "h". -Then type ready. -#create g23 -g23, of course -#user -test -r h23 && test ! -r g23 -#log -#next -6.1d 0 -6.1e 5 diff --git a/usr.bin/learn/lib/files/L6.1d b/usr.bin/learn/lib/files/L6.1d deleted file mode 100644 index dcf8678dc7a..00000000000 --- a/usr.bin/learn/lib/files/L6.1d +++ /dev/null @@ -1,16 +0,0 @@ -#print -What does "*b*" match? Clearly, any file -with a "b" anywhere in its name. Similarly, -how many files in this directory have -"se" somewhere in their name? -Type "answer N" when you figure it out. -#create arise -#create reset -#create set -#copyin -#user -#uncopyin -#match 3 -#log -#next -6.1e diff --git a/usr.bin/learn/lib/files/L6.1e b/usr.bin/learn/lib/files/L6.1e deleted file mode 100644 index cc640d4625d..00000000000 --- a/usr.bin/learn/lib/files/L6.1e +++ /dev/null @@ -1,19 +0,0 @@ -#print -There is exactly one file name which matches both - ab* -and - a?d -in the current directory. What is it? -Type "answer NAME" where NAME is its name. -#create abc -#create abd -#create add -#copyin -#user -#uncopyin -#match abd -#log -#next -7.1a 10 -7.2a 5 -7.3a 2 diff --git a/usr.bin/learn/lib/files/L6.2a b/usr.bin/learn/lib/files/L6.2a deleted file mode 100644 index b94e7b54f02..00000000000 --- a/usr.bin/learn/lib/files/L6.2a +++ /dev/null @@ -1,34 +0,0 @@ -#print -Since the '?' character only matches single -characters in file names, it is not useful for -questions like "how many files have names which -begin with the letter g?" There is another character - * -which can be used in patterns for file names -and matches any number of any kind of characters. -So - g* -selects all file names beginning with g, and - *x -selects all file names which end in x. Try - ls *x -How many files match? -Compare with an ordinary - ls -if you like. Type "answer N" eventually where -N is the number of files whose names end in "x". -#create abcx -#create abcxdef -#create memox -#create memoy -#create memoz -#create x -#create x53x -#copyin -#user -#uncopyin -#match 4 -#log -#next -6.2b 8 -6.1a 1 diff --git a/usr.bin/learn/lib/files/L6.2b b/usr.bin/learn/lib/files/L6.2b deleted file mode 100644 index faaf442be9f..00000000000 --- a/usr.bin/learn/lib/files/L6.2b +++ /dev/null @@ -1,22 +0,0 @@ -#print -There is one file in this directory whose name ends -in "memo". Find out that file name and print -the contents of the file. Then type "ready". -#create mymemo -This is the 7-line file "mymemo"; you should -have typed "ls *memo", which would print -"mymemo", and then typed the -command "cat mymemo". -Or just plain "cat *memo" would have worked. -But whatever you did, you got it right -and now you can type "ready". -#copyout -#user -#uncopyout -tail -7 .ocopy >X2 -#cmp mymemo X2 -#log -#next -6.1b 0 -6.1c 5 -6.1e 10 diff --git a/usr.bin/learn/lib/files/L7.1a b/usr.bin/learn/lib/files/L7.1a deleted file mode 100644 index 871f82f26d4..00000000000 --- a/usr.bin/learn/lib/files/L7.1a +++ /dev/null @@ -1,38 +0,0 @@ -#print -Sometimes ? is too flexible, and you -only want to allow a few characters. For example, -you might want to abbreviate - ls memo.ab memo.ac -without picking up "memo.ad", memo.ae", etc. -You can match one of a set of particular characters by -putting them in brackets "[]" in the list you use with "ls". -For example, - [bc] -matches either b or c but no other letters, -so "ls memo.a[bc]" is the abbreviation for -"ls memo.ab memo.ac". -You can have as many characters as needed between [ and ]. - -Type the "ls" command that recognizes - a1cat - a2cat - a3cat -and no other files. Then type "ready". -#create a1bat -#create a1cat -#create a2cat -#create a3cat -#create a4cat -#create acat -#copyin -#user -#uncopyin -#match ls a[123]cat -#match ls a[1-3]cat -#match ls a1cat a2cat a3cat -You were supposed to use a[123]cat. -Imagine doing it your way with 10 files. -#log -#next -8.1a 10 -8.2a 5 diff --git a/usr.bin/learn/lib/files/L7.2a b/usr.bin/learn/lib/files/L7.2a deleted file mode 100644 index 5f51b4bf6e9..00000000000 --- a/usr.bin/learn/lib/files/L7.2a +++ /dev/null @@ -1,30 +0,0 @@ -#print -Sometimes ? is too flexible, and you -only want to allow a few characters. For example, -you might want to abbreviate - ls memo.ab memo.ac -without picking up "memo.ad", "memo.ae", and so forth. -You can match one of a set of particular characters by -putting them in brackets "[]" in the list you use with "ls". -For example, - [bc] -matches either b or c but no other letters. Thus - ls memo.a[bc] -will list exactly "memo.ab" and "memo.ac" if present. - -How many of the files - xya, xyb, xyc, xyd -exist in this directory? -Type "answer N" where N is the number. -#create xyb -#create xyc -#create xye -#create xyf -#create xy1 -#copyin -#user -#uncopyin -#match 2 -#log -#next -7.2b 10 diff --git a/usr.bin/learn/lib/files/L7.2b b/usr.bin/learn/lib/files/L7.2b deleted file mode 100644 index a86c7f8d288..00000000000 --- a/usr.bin/learn/lib/files/L7.2b +++ /dev/null @@ -1,32 +0,0 @@ -#print -You can put any number of characters between [..] -characters, as in - [abcdef] -which matches any of the six letters from a to f; -and you can put something like that anywhere in a pattern -for a file name. For example, - ls [abcd]x -matches any of - ax, bx, cx, dx -You can also combine this with other operators such as -* or ?. For example, - ls [ab]? -matches all two-letter names beginning with a or b. -How would you ask for all names, of any length, ending -in 1 2 or 3? -You can experiment in this directory; eventually, -type the "ls" command you decide on followed by "ready". -#create a1 -#create a12 -#create a1a -#create a2 -#create a23 -#create aa1 -#create abc1 -#copyin -#user -#uncopyin -#match ls *[123] -#log -#next -8.1a 10 diff --git a/usr.bin/learn/lib/files/L7.3a b/usr.bin/learn/lib/files/L7.3a deleted file mode 100644 index f757a518a0c..00000000000 --- a/usr.bin/learn/lib/files/L7.3a +++ /dev/null @@ -1,28 +0,0 @@ -#print -Sometimes ? is too flexible, and you -only want to allow a few characters. For example, -you might want to abbreviate - ls memo.ab memo.ac -without picking up "memo.ad", "!"memo.ae", and so forth. -You can match one of a set of particular characters by -putting them in brackets "[]" in the list you use with "ls". -For example, - [bc] -matches either b or c but no other letters. -Thus the command - ls memo.a[bc] -would match "memo.ab", "memo.ac", and nothing else. -Try that command in this directory: type a plain -"ls" first, and then "ls memo.a[bc]". -How many files does "ls memo.a[bc]" match? -Type "answer N" where N is the number. -#create memo.ab -#create memo.abc -#create memo.bc -#copyin -#user -#uncopyin -#match 1 -#log -#next -7.3b 2 diff --git a/usr.bin/learn/lib/files/L7.3b b/usr.bin/learn/lib/files/L7.3b deleted file mode 100644 index 1d3b1072f53..00000000000 --- a/usr.bin/learn/lib/files/L7.3b +++ /dev/null @@ -1,17 +0,0 @@ -#print -You can use the [] characters anywhere you want -in a file name. For example, - ls a[bc]d -would match abd or acd, right? -What is the command that finds out how -many files are named "ax" or "bx"? -Type that command, then "ready". -#create ax -#create bx -#copyin -#user -#uncopyin -#match ls [ab]x -#log -#next -7.3c 2 diff --git a/usr.bin/learn/lib/files/L7.3c b/usr.bin/learn/lib/files/L7.3c deleted file mode 100644 index 8b87957631c..00000000000 --- a/usr.bin/learn/lib/files/L7.3c +++ /dev/null @@ -1,23 +0,0 @@ -#print -You can put any number of characters between the -brackets. For example, - ab[123456789] -could match up to 9 names, of the sort - ab1, ab2, ab3, ab4, ab5, ... -How many of the following names exist in this -directory? - p1end, p2end, p3end, p4end, p5end -Check with a ordinary "ls". Type "answer N" when you -know. -#once #create p1end -#once #create p3endx -#once #create p4end -#once #create p6end -#copyin -#user -#uncopyin -#match 2 -#log -#next -8.1a 10 -8.2a 5 diff --git a/usr.bin/learn/lib/files/L8.1a b/usr.bin/learn/lib/files/L8.1a deleted file mode 100644 index 2228490e877..00000000000 --- a/usr.bin/learn/lib/files/L8.1a +++ /dev/null @@ -1,25 +0,0 @@ -#print -Sometimes you want to request one of a limited -range of characters. This is possible with an -expression like - [a-d] -which matches a, b, c, or d. Thus, to take -some combinations - ab[c-f] -matches - abc, abd, abe, abf -Try typing "ls a[0-9]" -and see how many files it matches. Type that -number in the form "answer N". -#create a0 -#create a1 -#create a5 -#create ax -#copyin -#user -#uncopyin -#match 3 -#log -#next -9.1a 10 -9.2a 4 diff --git a/usr.bin/learn/lib/files/L8.2a b/usr.bin/learn/lib/files/L8.2a deleted file mode 100644 index 6b59b79f2f2..00000000000 --- a/usr.bin/learn/lib/files/L8.2a +++ /dev/null @@ -1,16 +0,0 @@ -#print -Will the command - ls georg[a-f] -match the name - george -Type yes or no. -Experiment first if you want. -#create george -#copyin -#user -#uncopyin -#match yes -#log -#next -8.2b 5 -9.1a 10 diff --git a/usr.bin/learn/lib/files/L8.2b b/usr.bin/learn/lib/files/L8.2b deleted file mode 100644 index 8fd3ef86c29..00000000000 --- a/usr.bin/learn/lib/files/L8.2b +++ /dev/null @@ -1,23 +0,0 @@ -#print -The command - ls [aeiou]*.c -will match all but one of the following names. - e.c - alpha.c - edward - u23.c -Which one? Type "answer NAME" where NAME -is the file that doesn't match. You can experiment -first, as usual. -#create alpha.c -#create e.c -#create edward -#create u23.c -#copyin -#user -#uncopyin -#match edward -#log -#next -8.2c 5 -9.1a 10 diff --git a/usr.bin/learn/lib/files/L8.2c b/usr.bin/learn/lib/files/L8.2c deleted file mode 100644 index 9a8764632a8..00000000000 --- a/usr.bin/learn/lib/files/L8.2c +++ /dev/null @@ -1,27 +0,0 @@ -#print -As an example more complicated than you will -probably ever need, consider - ?[a-c]* -which matches what? Well the first character -can be anything; the second must be a, b, or c; and -nothing matters thereafter. So it matches - aaa - abc - xa - 3c25 -but not - a - ghi -and so forth. -Will it match - %a25 -Try some experiments, then type yes or no. -#create %a25 -#copyin -#user -#uncopyin -#match yes -#log -#next -9.1a 10 -9.2a 4 diff --git a/usr.bin/learn/lib/files/L9.1a b/usr.bin/learn/lib/files/L9.1a deleted file mode 100644 index 2da6ae37899..00000000000 --- a/usr.bin/learn/lib/files/L9.1a +++ /dev/null @@ -1,36 +0,0 @@ -#print -The patterns for selecting file names that have been discussed -can be used with other commands than "ls". For example, -they can be used with the "cat" command to print files. -It is common for a memo stored in several -files to use files named "part1", "part2", etc. -so that commands like - cat part* -will print everything. -In this directory there are several -short files named "sec0", "sec1", "sec3", -and so forth. -There are various names of animals in the files; -find out the largest animal named in the files -and type "answer NAME" where NAME is that animal. -#create sec0 -dog mouse cat -#create sec1 -rabbit weasel -pig hamster -#create sec2 -this file doesn't happen -to have any animal names in it. -#create sec3 -fox elephant sheep -duck rat -#create sec4 -groundhog bobcat -mole beaver -#copyin -#user -#uncopyin -#match elephant -#log -#next -10.1a 10 diff --git a/usr.bin/learn/lib/files/L9.2a b/usr.bin/learn/lib/files/L9.2a deleted file mode 100644 index eac03df5102..00000000000 --- a/usr.bin/learn/lib/files/L9.2a +++ /dev/null @@ -1,30 +0,0 @@ -#print -You can use patterns for file names with commands -other than "ls". For example, you can use them with -the "cat" command to print files. -This directory has three files named - parta - partb - partc -You can use - cat part? -to print all of them. Try that; then -type "ready". -#create parta -This is file parta; -it has two lines. -#create partb -File partb here - has only one line. -#create partc -And now in file partc, which has -the enormous total of -three lines. -#create partxxx -You shouldn't have printed this one. -#copyin -#user -#uncopyin -grep 'cat part?' .copy >/dev/null -#log -#next -9.2b 5 diff --git a/usr.bin/learn/lib/files/L9.2b b/usr.bin/learn/lib/files/L9.2b deleted file mode 100644 index 64b9b0970d5..00000000000 --- a/usr.bin/learn/lib/files/L9.2b +++ /dev/null @@ -1,22 +0,0 @@ -#print -You can also use the "*" operator. For example, -print the contents of all the files in this -directory whose names begin with the letter 'p'. -Use just one "cat" command. -Then type "ready". -#create p1 -There are only two such files. This is the first -one and it is two lines long. -#create ppx - -This is the second file. Its first line -is blank, and then there are three lines of -text of which this is the last. -#copyin -#user -#uncopyin -grep 'cat p\*' .copy >/dev/null -#log -#next -10.1a 10 -9.2c 5 diff --git a/usr.bin/learn/lib/files/L9.2c b/usr.bin/learn/lib/files/L9.2c deleted file mode 100644 index ed1c330878a..00000000000 --- a/usr.bin/learn/lib/files/L9.2c +++ /dev/null @@ -1,26 +0,0 @@ -#print -And as an example of the [] operators again, -print all the files in this directory whose -names begin with either 'a' or 'c'. -That will tell you to type either 'yes' -or 'no' - do what it says. -#create a1 -Type -#create a2 -y -#create b -n -o -#create cxx -e -#create cz23 -s -(on one line, please) -#copyin -#user -#uncopyin -#match yes -#log -#next -10.1a 10 -10.3a 2 diff --git a/usr.bin/learn/lib/macros/L0 b/usr.bin/learn/lib/macros/L0 deleted file mode 100644 index 40bb3a2c56c..00000000000 --- a/usr.bin/learn/lib/macros/L0 +++ /dev/null @@ -1,2 +0,0 @@ -#next -1.1a 5 diff --git a/usr.bin/learn/lib/macros/L1.1a b/usr.bin/learn/lib/macros/L1.1a deleted file mode 100644 index b8a10a09ab2..00000000000 --- a/usr.bin/learn/lib/macros/L1.1a +++ /dev/null @@ -1,28 +0,0 @@ -#print -WARNING: This course was written for UNIX in 1979, not 1999, -and has not yet been updated. Some details may be way out of date! -In particular, Berkeley UNIX includes the -me macros, which are -preferred over -ms, but we don't yet have a course on the -me macros. - -This script deals with the use of the "-ms" macro -package to produce Bell Laboratories style documents. -Before trying it, you should be familiar with the -editor. To test that, please enter the file -typed below, _______exactly __as __is, into file "decl". Then -type "ready". - -#create Ref -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -#print Ref -#user -#cmp decl Ref -#log -#next -2.1a 10 diff --git a/usr.bin/learn/lib/macros/L10.1a b/usr.bin/learn/lib/macros/L10.1a deleted file mode 100644 index be790492494..00000000000 --- a/usr.bin/learn/lib/macros/L10.1a +++ /dev/null @@ -1,52 +0,0 @@ -#print -What if you don't want the cover sheet? Nroff has -an option to print only special pages. In particular, - nroff -ms -o1- files ... -will begin printing at page 1, and skip page 0, the cover sheet. -If you only want the cover sheet, you need the command - nroff -ms -o0 files ... -which prints only page zero. Try printing -only the cover sheet of the file "decl". -Then type "ready" as usual. -#once nroff -ms -o0 decl >X1 & -#create decl -.RP -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -66 .ocopy >X2 -#cmp X1 X2 -#log -#next -11.1a 10 diff --git a/usr.bin/learn/lib/macros/L11.1a b/usr.bin/learn/lib/macros/L11.1a deleted file mode 100644 index a58f7d47436..00000000000 --- a/usr.bin/learn/lib/macros/L11.1a +++ /dev/null @@ -1,96 +0,0 @@ -#print -The most complex format is the TM (technical memorandum) -format. If you use that, instead of the IM format, -you get the usual "MEMORANDUM FOR FILE" message. In addition, -you usually want to specify the TM number, case numbers, and -so forth. The command line for TM format (which should also -be the first line given) should read: - - .TM memo-no. case-no. filing-no. - -so that, for example, the command line - - .TM 75-1274-1 39199 39199-11 - -indicates a TM number of 75-1274-1, a charging case number -of 39199, and a filing case number of 39199-11. Suppose the -number for this memo is - 75-1776-1 -and the charging and filing cases are both - 12345 -Edit the file "decl" for TM format and run it off. -#create Ref -.TM 75-1776-1 12345 12345 -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X1 & -#create decl -.IM -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -66 .ocopy >X2 -#cmp X1 X2 -#log -#next -12.1a 10 diff --git a/usr.bin/learn/lib/macros/L12.1a b/usr.bin/learn/lib/macros/L12.1a deleted file mode 100644 index a9b1c875dea..00000000000 --- a/usr.bin/learn/lib/macros/L12.1a +++ /dev/null @@ -1,100 +0,0 @@ -#print -With a TM you want a cover sheet. The cover sheet doesn't look too -nice when printed on a computer terminal, but you should -know how to set it up so that you can put it on the typesetter, -which does an attractive job of imitating the official printed -form. Basically you must make two changes to get a cover sheet -with normal formatting. First, you should add to each .AU line -the author's room number and extension. For example, - .AU "MH 2C-569" "6377" - M. E. Lesk -indicates that Lesk's room is MH 2C-569 and his extension is 6377. -The room number is enclosed in quotes to indicate that it is one -unit, even though it contains a blank. The quotes around -the extension are harmless but unnecessary. Also, you -must add the command - .CS 1 2 3 4 5 6 -after the ".AE" line. The six numbers are (from left to right) -the number of pages of text, number of pages of "other", -the total number of pages, the number of references, the number -of figures and the number of tables. Try editing -the usual file "decl" to indicate that Mr. Jefferson's -room number is MH 2A-111 and his extension is 1776. -Request a cover sheet with the above meaningless numbers, -just to see where they go. Then run off the document again. -#create Ref -.TM 75-1776-1 12345 12345 -.TL -Declaration of Independence -.AU "MH 2A-111" 1776 -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.CS 1 2 3 4 5 6 -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X1 & -#create decl -.TM 75-1776-1 12345 12345 -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -132 .ocopy >X2 -#cmp X1 X2 -#log -#next -13.1a 10 diff --git a/usr.bin/learn/lib/macros/L13.1a b/usr.bin/learn/lib/macros/L13.1a deleted file mode 100644 index 1375887a380..00000000000 --- a/usr.bin/learn/lib/macros/L13.1a +++ /dev/null @@ -1,104 +0,0 @@ -#print -A couple of details about TM formats. -(1) The computer has this habit of putting the real date on things. -Typically BTL authors wish to lie about the date. There is a command -for this: - .DA July 4, 1776 -will replace the current date everywhere by the specified date. -(2) Also about the date: most people don't like it on each page. -The normal date command is thus: - .ND July 4, 1776 -which says "no date on each page; in the TM heading area where -the date is needed, use July 4, 1776". -Either date command should be placed just after the .TM line. -(3) There may be other keywords. These are indicated by -the sequence - .OK - word 1 - word 2 -inserted before the .AB line. -All right. Change "decl" to show a date of July 4, 1776, -using the ".ND" date command; and add as "other keywords" -"Democracy" and "Tyranny". Then run off ONLY the cover -sheet (remember nroff -ms -o0 file ...?). End with "ready". -#create Ref -.TM 75-1776-1 12345 12345 -.ND July 4, 1776 -.TL -Declaration of Independence -.AU "MH 2A-111" 1776 -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.OK -Democracy -Tyranny -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.CS 1 2 3 4 5 6 -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms -o0 Ref >X1 & -#create decl -.TM 75-1776-1 12345 12345 -.TL -Declaration of Independence -.AU "MH 2A-111" 1776 -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.CS 1 2 3 4 5 6 -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -66 .ocopy >X2 -#cmp X1 X2 -#log -#next -14.1a 10 diff --git a/usr.bin/learn/lib/macros/L14.1a b/usr.bin/learn/lib/macros/L14.1a deleted file mode 100644 index fd8ef9b86b5..00000000000 --- a/usr.bin/learn/lib/macros/L14.1a +++ /dev/null @@ -1,104 +0,0 @@ -#print -What if there are several authors? Well, you use several .AU -commands. Suppose we promote Richard Henry Lee to co-author -of our file "decl". Then we could have - .TM memo and case numbers - .ND fake date - .TL - Declaration of Independence - .AU room and phone for Jefferson - Thomas Jefferson - .AU room and phone for Lee - Richard Henry Lee - .AI - as before ... -as the top of the file. Rearrange "decl" this way -and run it off. Then type "ready". -Make Lee's room number MH 2B-222 and his extension 1824. -#create Ref -.TM 75-1776-1 12345 12345 -.ND July 4, 1776 -.TL -Declaration of Independence -.AU "MH 2A-111" 1776 -Thomas Jefferson -.AU "MH 2B-222" 1824 -Richard Henry Lee -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.OK -tyranny -democracy -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.CS 1 2 3 4 5 6 -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X1 & -#create decl -.TM 75-1776-1 12345 12345 -.ND July 4, 1776 -.TL -Declaration of Independence -.AU "MH 2A-111" 1776 -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.OK -tyranny -democracy -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.CS 1 2 3 4 5 6 -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -132 .ocopy >X2 -#cmp X1 X2 -#log -#next -15.1a 10 diff --git a/usr.bin/learn/lib/macros/L15.1a b/usr.bin/learn/lib/macros/L15.1a deleted file mode 100644 index 1418c23209d..00000000000 --- a/usr.bin/learn/lib/macros/L15.1a +++ /dev/null @@ -1,306 +0,0 @@ -#print -Here's a new document. In the file "Ascent" is a supposed memo. -It begins immediately with the text, but the paragraphs are -marked with ".PP" commands. Add the initial material -as follows and run it of as a TM: - Title: Ascending the Riffelberg - Author: Mark Twain - Author's address: Hannibal, Mo. - TM number: 75-1868-1 - Case number 39199 - File number: 39425-2 - Author's room number: MH 2C-520 - Author's extension: 9876 - Abstract: - Why climb Everest? - Because it is there, said Mallory. - Other keywords: Mountaineering - Cover sheet numbers: just use 1 2 3 4 5 6 -OK? You can still look at "decl" to see the format. -#create Ref -.TM 75-1868-1 39199 39425-2 -.TL -Ascending the Riffelberg -.AU "MH 2C-520" 9876 -Mark Twain -.AI -Hannibal, Mo. -.OK -Mountaineering -.AB -Why climb Everest? -Because it is there, said Mallory. -.AE -.CS 1 2 3 4 5 6 -.PP -I sat silent some time, then turned to Harris and said: -``My mind is made up.'' -Something in my tone struck him; and when he glanced -at my eye and read what was written there, his face paled -perceptibly. He hesitated a moment, then said: -``Speak.'' -I answered, with perfect calmness: -``I WILL ASCEND THE RIFFELBERG.'' -If I had shot my poor friend he could not have fallen from -his chair more suddenly. If I had been his father he -could not have pleaded harder to get me to give up my -purpose. But I turned a deaf ear to all he said. When he -perceived at last that nothing could alter my determination, -he ceased to urge, and for a while the deep silence was broken only -by his sobs. I sat in marble resolution, with my -eyes fixed upon vacancy, for in spirit I was already -wrestling with the perils of the mountains, and my friend sat -gazing at me in adoring admiration through his tears. At -last he threw himself upon me in a loving embrace and -exclaimed in broken tones: -``Your Harris will never desert you. We will die together!'' -I cheered the noble fellow with praises, and soon his fears -were forgotten and he was eager for the adventure. He -wanted to summon the guides at once and leave at two in -the morning, as he supposed the custom was; but I explained that nobody -was looking at that hour; and that the start in the dark -was not usually made from the village but -from the first night's resting-place on the mountainside. I -said we would leave the village at 3 or 4 p.m. on the morrow; -meantime he could notify the guides, and also let the public -know of the attempt which we proposed to make. -.PP -I went to bed, but not to sleep. No man can sleep when -he is about to undertake one of these Alpine exploits. I -tossed feverishly all night long, and was glad enough when -I heard the clock strike half past eleven and knew it was -time to get up for dinner. I rose, jaded and rusty, and went -to the noon meal, where I found myself the center of interest and -curiosity; for the news was already abroad. It is not -easy to eat calmly when you are a lion, but it is very -pleasant, nevertheless. -.PP -As usual, at Zermatt, when a great ascent is about to be -undertaken, everybody, native and foreign, laid aside his -own projects and took up a good position to observe the -start. The expedition consisted of 198 persons, including -the mules; or 205, including the cows. -.PP -It was full four o'clock in the afternoon before my cavalcade -was entirely ready. At that hour it began to move. In -point of numbers and spectacular effect, it was the most -imposing expedition that had ever marched from Zermatt. -.PP -I commanded the chief guide to arrange the men and -animals in single file, twelve feet apart, and lash them all -together on a strong rope. He objected that the first two -miles was a dead level, with plenty of room, and that the -rope was never used except in very dangerous places. But I -would not listen to that. My reading had taught me that -many serious accidents had happened in the Alps simply -from not having the people tied up soon enough; I was not -going to add one to the list. The guide then obeyed my -order. -.PP -When the procession stood at ease, roped together, and -ready to move, I never saw a finer sight. It was 3,122 feet -long - over half a mile; every man but Harris and me was -on foot, and had on his green veil and his blue goggles, and -his white rag around his hat, and his coil of rope over one -shoulder and under the other, and his ice-ax in his belt, -and carried his Alpenstock in his left hand, his umbrella -(closed) in his right, and his crutches slung at his back. -.PP -The burdens of the pack-mules and the horns of the cows -were decked with the Edelweiss and the Alpine rose. -.PP -I and my agent were the only persons mounted. We -were in the post of danger in the extreme rear, and tied -securely to five guides apiece. Our armor-bearers carried our -ice-axes, Alpenstocks, and other implements for us. We -were mounted upon very small donkeys, as a measure of -safety; in time of peril we could straighten our legs and -stand up, and let the donkey walk from under. Still, I cannot -recommend this sort of animal - at least for excursions -of mere pleasure - because his ears interrupt the view. I -and my agent possessed the regulation mountaineering costumes, -but concluded to leave them behind. Out of respect -for the great numbers of tourists of both sexes who would -be assembled in front of the hotels to see us pass, and also -out of respect for the many tourists whom we expected to -encounter on our expedition, we decided to make the -ascent in evening dress. -.PP -At fifteen minutes past four I gave the command to -move, and my subordinates passed it along the line. The -great crowd in front of the Monte Rosa hotel parted in -twain, with a cheer, as the procession approached; and as -the head of it was filing by I gave the order - unlimber - -make ready - hoist - and with one impulse up went my -half-mile of umbrellas. It was a beautiful sight, and a total -surprise to the spectators. Nothing like that had ever been -seen in the Alps before. The applause it brought forth was -deeply gratifying to me, and I rode by with my plug hat in -my hand to testify my appreciation of it. It was the only -testimony I could offer, for I was too full to speak. -#once #create Ascent -.PP -I sat silent some time, then turned to Harris and said: -``My mind is made up.'' -Something in my tone struck him; and when he glanced -at my eye and read what was written there, his face paled -perceptibly. He hesitated a moment, then said: -``Speak.'' -I answered, with perfect calmness: -``I WILL ASCEND THE RIFFELBERG.'' -If I had shot my poor friend he could not have fallen from -his chair more suddenly. If I had been his father he -could not have pleaded harder to get me to give up my -purpose. But I turned a deaf ear to all he said. When he -perceived at last that nothing could alter my determination, -he ceased to urge, and for a while the deep silence was broken only -by his sobs. I sat in marble resolution, with my -eyes fixed upon vacancy, for in spirit I was already -wrestling with the perils of the mountains, and my friend sat -gazing at me in adoring admiration through his tears. At -last he threw himself upon me in a loving embrace and -exclaimed in broken tones: -``Your Harris will never desert you. We will die together!'' -I cheered the noble fellow with praises, and soon his fears -were forgotten and he was eager for the adventure. He -wanted to summon the guides at once and leave at two in -the morning, as he supposed the custom was; but I explained that nobody -was looking at that hour; and that the start in the dark -was not usually made from the village but -from the first night's resting-place on the mountainside. I -said we would leave the village at 3 or 4 p.m. on the morrow; -meantime he could notify the guides, and also let the public -know of the attempt which we proposed to make. -.PP -I went to bed, but not to sleep. No man can sleep when -he is about to undertake one of these Alpine exploits. I -tossed feverishly all night long, and was glad enough when -I heard the clock strike half past eleven and knew it was -time to get up for dinner. I rose, jaded and rusty, and went -to the noon meal, where I found myself the center of interest and -curiosity; for the news was already abroad. It is not -easy to eat calmly when you are a lion, but it is very -pleasant, nevertheless. -.PP -As usual, at Zermatt, when a great ascent is about to be -undertaken, everybody, native and foreign, laid aside his -own projects and took up a good position to observe the -start. The expedition consisted of 198 persons, including -the mules; or 205, including the cows. -.PP -It was full four o'clock in the afternoon before my cavalcade -was entirely ready. At that hour it began to move. In -point of numbers and spectacular effect, it was the most -imposing expedition that had ever marched from Zermatt. -.PP -I commanded the chief guide to arrange the men and -animals in single file, twelve feet apart, and lash them all -together on a strong rope. He objected that the first two -miles was a dead level, with plenty of room, and that the -rope was never used except in very dangerous places. But I -would not listen to that. My reading had taught me that -many serious accidents had happened in the Alps simply -from not having the people tied up soon enough; I was not -going to add one to the list. The guide then obeyed my -order. -.PP -When the procession stood at ease, roped together, and -ready to move, I never saw a finer sight. It was 3,122 feet -long - over half a mile; every man but Harris and me was -on foot, and had on his green veil and his blue goggles, and -his white rag around his hat, and his coil of rope over one -shoulder and under the other, and his ice-ax in his belt, -and carried his Alpenstock in his left hand, his umbrella -(closed) in his right, and his crutches slung at his back. -.PP -The burdens of the pack-mules and the horns of the cows -were decked with the Edelweiss and the Alpine rose. -.PP -I and my agent were the only persons mounted. We -were in the post of danger in the extreme rear, and tied -securely to five guides apiece. Our armor-bearers carried our -ice-axes, Alpenstocks, and other implements for us. We -were mounted upon very small donkeys, as a measure of -safety; in time of peril we could straighten our legs and -stand up, and let the donkey walk from under. Still, I cannot -recommend this sort of animal - at least for excursions -of mere pleasure - because his ears interrupt the view. I -and my agent possessed the regulation mountaineering costumes, -but concluded to leave them behind. Out of respect -for the great numbers of tourists of both sexes who would -be assembled in front of the hotels to see us pass, and also -out of respect for the many tourists whom we expected to -encounter on our expedition, we decided to make the -ascent in evening dress. -.PP -At fifteen minutes past four I gave the command to -move, and my subordinates passed it along the line. The -great crowd in front of the Monte Rosa hotel parted in -twain, with a cheer, as the procession approached; and as -the head of it was filing by I gave the order - unlimber - -make ready - hoist - and with one impulse up went my -half-mile of umbrellas. It was a beautiful sight, and a total -surprise to the spectators. Nothing like that had ever been -seen in the Alps before. The applause it brought forth was -deeply gratifying to me, and I rode by with my plug hat in -my hand to testify my appreciation of it. It was the only -testimony I could offer, for I was too full to speak. -#once nroff -ms Ref >X1 & -#create decl -.TM 75-1776-1 12345 12345 -.ND July 4, 1776 -.TL -Declaration of Independence -.AU "MH 2A-111" 1776 -Thomas Jefferson -.AU "MH 2B-222" 1824 -James Madison -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.OK -tyranny -democracy -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#create script -1,$-264d -w -q -#copyout -#user -#uncopyout -e - .ocopy <script -#cmp X1 .ocopy -#fail -Sorry, that wasn't right. - -To see exactly what you are doing, after -making your insertions, compare the file -with file "Ref" using "diff". - -OK, maybe you'll get a chance to do it over: - -#log diff --git a/usr.bin/learn/lib/macros/L2.1a b/usr.bin/learn/lib/macros/L2.1a deleted file mode 100644 index b1ea3dba6f8..00000000000 --- a/usr.bin/learn/lib/macros/L2.1a +++ /dev/null @@ -1,25 +0,0 @@ -#print -When you have some document typed in "-ms" style, -you run it off on your terminal by saying: - - nroff -ms file - -where "file" is the name of the file it is on. For example, -the file "decl" in this directory is in a suitable format -for running off this way. Do so. Then type "ready". -#create decl -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -#copyin -#user -#uncopyin -#match nroff -ms decl -#log -#next -3.1a 10 diff --git a/usr.bin/learn/lib/macros/L3.1a b/usr.bin/learn/lib/macros/L3.1a deleted file mode 100644 index 0cba80296aa..00000000000 --- a/usr.bin/learn/lib/macros/L3.1a +++ /dev/null @@ -1,70 +0,0 @@ -#print -The file "decl" began with ".PP". All files sent -to -ms MUST begin with a "-ms" command line. You can -tell these command lines, in general, because they -begin with a period and have only capital letters on them. -The ".PP" command indicates a new paragraph. -So to add another paragraph to a file, you put a ".PP" -in front and then type in the new text. Here is the -next paragraph of the declaration of independence. Add -it to the end of the file "decl" that you've been working -with. You can do that most easily by picking up the text -from file "para2", or you can type it in again. It is -not necessary to keep every word on exactly -the line it was, since the program will rearrange them. -But the ".PP" must be on a line by itself. Then -run off the new version. - - -#create Ref -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X2 & -#create decl -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -#create para2 -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#print para2 -#copyout -#user -#uncopyout -tail -66 .ocopy >X1 -#cmp X1 X2 -#log -#next -4.1a 10 diff --git a/usr.bin/learn/lib/macros/L4.1a b/usr.bin/learn/lib/macros/L4.1a deleted file mode 100644 index a6acce2354c..00000000000 --- a/usr.bin/learn/lib/macros/L4.1a +++ /dev/null @@ -1,65 +0,0 @@ -#print -Usually, of course, a document contains more than -just paragraphs. In particular, most -documents have titles, which are entered with "-ms" -by saying - .TL - title goes here - .PP - paragraphs of documents... -There is the same "decl" file here: add a title -"Declaration of Independence" and -run it off again. -#create Ref -.TL -Declaration of Independence -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X2 & -#create decl -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -66 .ocopy >X1 -#cmp X1 X2 -#log -#next -5.1a 10 diff --git a/usr.bin/learn/lib/macros/L5.1a b/usr.bin/learn/lib/macros/L5.1a deleted file mode 100644 index cdcf8160c39..00000000000 --- a/usr.bin/learn/lib/macros/L5.1a +++ /dev/null @@ -1,69 +0,0 @@ -#print -Also, most documents have one or more authors. -Authors are indicated by a preceding line of ".AU". -Thus you would say - .TL - title - .AU - author - .PP - text -OK, edit "decl" again: the author is Thomas Jefferson. -Insert this and run the document off. -#create Ref -.TL -Declaration of Independence -.AU -Thomas Jefferson -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X2 & -#create decl -.TL -Declaration of Independence -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -66 .ocopy >X1 -#cmp X1 X2 -#log -#next -6.1a 10 diff --git a/usr.bin/learn/lib/macros/L6.1a b/usr.bin/learn/lib/macros/L6.1a deleted file mode 100644 index ec640d4c55d..00000000000 --- a/usr.bin/learn/lib/macros/L6.1a +++ /dev/null @@ -1,74 +0,0 @@ -#print -Usually, in addition to the author, you want -to specify his address, -which is given after a command ".AI" (Author's institution). -This should follow immediately after the author's name. -In the usual file, "decl", put in Jefferson's -address as - -The Continental Congress -Philadelphia, Pa. 19104 - -Then run it off and type "ready". -#create Ref -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X1 & -#create decl -.TL -Declaration of Independence -.AU -Thomas Jefferson -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -66 .ocopy >X2 -#cmp X1 X2 -#log -#next -7.1a 10 diff --git a/usr.bin/learn/lib/macros/L7.1a b/usr.bin/learn/lib/macros/L7.1a deleted file mode 100644 index 07de402cef2..00000000000 --- a/usr.bin/learn/lib/macros/L7.1a +++ /dev/null @@ -1,80 +0,0 @@ -#print -Another standard feature of scientific papers, although -not always present is an abstract. It should be placed -after the author's institution, but before the text, -and surrounded by the commands ".AB" and ".AE". -Let's make up an imaginary abstract - how about - - This paper describes advances in scattering - theory of colonies from mother countries. - -Add this to the usual "decl" file and run it off. -#create Ref -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X1 & -#create decl -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -66 .ocopy >X2 -#cmp X2 X1 -#log -#next -8.1a 10 diff --git a/usr.bin/learn/lib/macros/L8.1a b/usr.bin/learn/lib/macros/L8.1a deleted file mode 100644 index eb815f06952..00000000000 --- a/usr.bin/learn/lib/macros/L8.1a +++ /dev/null @@ -1,82 +0,0 @@ -#print -So far we have run this off in a sort of proofreading format -that includes all the data but doesn't really look like anything -in the BTL style guide. It is possible, preceding the -title, to put one of three commands to indicate a particular -Bell Laboratories format. The simplest of these is .IM -(internal memorandum). Try putting .IM in front of the -text; then run it off and see what it looks like. -#create Ref -.IM -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X1 & -#create decl -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -66 .ocopy >X2 -#cmp X1 X2 -#log -#next -9.1a 10 diff --git a/usr.bin/learn/lib/macros/L9.1a b/usr.bin/learn/lib/macros/L9.1a deleted file mode 100644 index c5ca4f9522b..00000000000 --- a/usr.bin/learn/lib/macros/L9.1a +++ /dev/null @@ -1,83 +0,0 @@ -#print -The next format to mention is the RP (released paper) -format. If you use that, instead of the IM format, -you get the standard Bell Labs released paper style. -Change the first line of file "decl" to read - .RP -and run it off. Note that you get a cover page as well as the -first page. -#create Ref -.RP -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#once nroff -ms Ref >X1 & -#create decl -.IM -.TL -Declaration of Independence -.AU -Thomas Jefferson -.AI -The Continental Congress -Philadelphia, Pa. 19104 -.AB -This paper describes advances in scattering theory -of colonies from mother countries. -.AE -.PP -When in the course of human events, it becomes -necessary for one people to dissolve the political bands which have -connected them with another, and to assume among the -powers of the earth the separate and equal station to which -the laws of Nature and of Nature's God entitle them, a decent -respect to the opinions of mankind requires that they should -declare the causes which impel them to the separation. -.PP -We hold these truths to be self-evident, that all men -are created equal, that they are endowed by their creator -with certain unalienable rights, that among these are life, liberty, -and the pursuit of happiness. That to secure these rights, -governments are instituted among men, deriving their just -powers from the consent of the governed. That whenever -any form of government becomes destructive of these ends, -it is the right of the people to alter or to abolish it, and -to institute new government, laying its foundation on such -principles and organizing its powers in such form, as to them -shall seem most likely to effect their safety and happiness. -#copyout -#user -#uncopyout -tail -132 .ocopy >X2 -#cmp X1 X2 -#log -#next -10.1a 10 diff --git a/usr.bin/learn/lib/morefiles/L0 b/usr.bin/learn/lib/morefiles/L0 deleted file mode 100644 index bab7601e708..00000000000 --- a/usr.bin/learn/lib/morefiles/L0 +++ /dev/null @@ -1,2 +0,0 @@ -#next -0.1a 10 diff --git a/usr.bin/learn/lib/morefiles/L0.1a b/usr.bin/learn/lib/morefiles/L0.1a deleted file mode 100644 index 70e81e74f1e..00000000000 --- a/usr.bin/learn/lib/morefiles/L0.1a +++ /dev/null @@ -1,25 +0,0 @@ -#print -WARNING: This course was written for UNIX in 1979, not 1999, -and has not yet been updated. Some details may be way out of date! - -In the basic files course you learned about the "ls" command -for listing the names of files in the current directory. -You will now learn some of the extra abilities of "ls". -UNIX maintains a lot more information about a file than just -its name; this extra information includes the size of the -file, the date and time it was last changed, the owner, -and scattered other miscellany. To see this "long" list of information, -use the command "ls -l". (That's an "ell", not a "one".) -The "-l" is called an "optional argument", -since it may or may not be present. - -To begin, try just "ls -l", then type "ready". -#create junk -this is garbage -#copyin -#user -#uncopyin -#match ls -l -#log -#next -0.1b 10 diff --git a/usr.bin/learn/lib/morefiles/L0.1b b/usr.bin/learn/lib/morefiles/L0.1b deleted file mode 100644 index 61147108bf3..00000000000 --- a/usr.bin/learn/lib/morefiles/L0.1b +++ /dev/null @@ -1,43 +0,0 @@ -#print -When you ask for "ls -l", the first line, -which says "total N", is a measure of how much -file space is used by the files in this directory. -The part of the listing that says something like -"-rw-rw-r--" tells you the read and write -permissions for the file -- in effect, -who can do what to it. -The second field is the number of "links" to the file. -We won't worry about these two right now. - -The name in the third field is the owner of the file. -The fourth field is the size of the file in characters, -which is often interesting. The rest of the listing is -the date and time the file was last changed, and its name. - -What is the largest file in this directory? -(Don't use the previous list - I've changed things.) -Type "answer name", where "name" is the name of the -largest file. -#create big -stuff -#create biggest -not really -#create X1 -morestuf -#create m -moremore moremore moremore moremore moremore moremore moremore moremore moremore -moremore moremore moremore moremore moremore moremore moremore moremore moremore -moremore moremore moremore moremore moremore moremore moremore moremore moremore -moremore moremore moremore moremore moremore moremore moremore moremore moremore -moremore moremore moremore moremore moremore moremore moremore moremore moremore -#copyin -#user -#uncopyin -#match m -#bad biggest -You didn't look at the sizes, did you? -#bad big -You didn't look at the sizes, did you? -#log -#next -0.1c 10 diff --git a/usr.bin/learn/lib/morefiles/L0.1c b/usr.bin/learn/lib/morefiles/L0.1c deleted file mode 100644 index 721e7417e2b..00000000000 --- a/usr.bin/learn/lib/morefiles/L0.1c +++ /dev/null @@ -1,17 +0,0 @@ -#print -How many characters are there in the file whose name begins -with "r"? Type "answer N", where N is the number of characters -you found. -#create ref -hello world -#create Ref -hello -#copyin -#user -#uncopyin -#match 12 -#bad 6 -"R" is not___ the same as "r". Look again. -#log -#next -0.1d 10 diff --git a/usr.bin/learn/lib/morefiles/L0.1d b/usr.bin/learn/lib/morefiles/L0.1d deleted file mode 100644 index 66404c10060..00000000000 --- a/usr.bin/learn/lib/morefiles/L0.1d +++ /dev/null @@ -1,14 +0,0 @@ -#print -Is the file "ref" bigger than the file "ref1"? -Answer yes or no. -#create ref -now is the time. -#create ref1 -now is the time for all good men. -#copyin -#user -#uncopyin -#match no -#log -#next -0.1e 10 diff --git a/usr.bin/learn/lib/morefiles/L0.1e b/usr.bin/learn/lib/morefiles/L0.1e deleted file mode 100644 index e9df94281cb..00000000000 --- a/usr.bin/learn/lib/morefiles/L0.1e +++ /dev/null @@ -1,24 +0,0 @@ -#print -The list of file names from "ls" can also be obtained -sorted by the date the file was most recently changed, -with the newest files listed first. This list is -obtained by typing "ls -t". - -What is the oldest file in this directory? -Type "answer name", where "name" is the oldest file. -#create X1 -stuff -#create X2 -stuff -#create X3 -stuff -# -#copyin -#user -#uncopyin -ls -t | tail -1 >X1 -tail -1 .copy >test -#cmp X1 test -#log -#next -0.1f 10 diff --git a/usr.bin/learn/lib/morefiles/L0.1f b/usr.bin/learn/lib/morefiles/L0.1f deleted file mode 100644 index c2d104b6be0..00000000000 --- a/usr.bin/learn/lib/morefiles/L0.1f +++ /dev/null @@ -1,13 +0,0 @@ -#print -You can combine the optional arguments to "ls"; for example -you can get the "long" list sorted by time of last change -by saying - ls -lt -Try that, then type "ready". -#copyin -#user -#uncopyin -#match ls -lt -#log -#next -0.1g 10 diff --git a/usr.bin/learn/lib/morefiles/L0.1g b/usr.bin/learn/lib/morefiles/L0.1g deleted file mode 100644 index afe676de0f6..00000000000 --- a/usr.bin/learn/lib/morefiles/L0.1g +++ /dev/null @@ -1,10 +0,0 @@ -#print -Is "ls -tl" identical to "ls -lt"? Try it, -then type yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -1.1a 10 diff --git a/usr.bin/learn/lib/morefiles/L1.1a b/usr.bin/learn/lib/morefiles/L1.1a deleted file mode 100644 index 6bdc233ed69..00000000000 --- a/usr.bin/learn/lib/morefiles/L1.1a +++ /dev/null @@ -1,244 +0,0 @@ -#print -One of the more useful programs on Unix is "spell", which -looks for spelling mistakes in a set of files. Although spell -is not perfect, it does a reasonable job of presenting you -with a list of possibilities. To look for mistakes in a set -of files, you simply say - - spell filenames - -and of course you can use shorthands like *, ? and [] to name -the files. For practice, there are some files whose names begin -with "memo" in this directory; somewhere in one of them -is a legitimate spelling mistake. Use spell to find it, then -type "answer word", where "word" is the mistake. -Spell may also output a number of words -that aren't mistakes; you may have to select real errors -from the false ones. - -By the way, an alternative is ispell, which you'll find in the -Ports Tree on OpenBSD. Ispell gives the words one at a time and -presents alternatives. -#create memo1 -(This comes from a federalist paper by Alexander Hamilton.) - It has been mentioned as one of the advantages to be expected -from the cooperation of the Senate, in the business -of appointments, that it would contribute to the -stability of the administration. The consent of that body -would be necessary to displace as well as to appoint. A -change of the Chief Magistrate, therefore, would not occasion -so violent or so general a revolution in the officers -of the government as might be expected if he were the -sole disposer of offices. Where a man in any station had -given satisfactory evidence of his fitness for it, a new -President would be restrained from attempting a change -in favor of a person more agreeable to him by the apprehension -that a discountenance of the Senate might frustrate -the attempt, and bring some degree of discredit -upon himself. Those who can best estimate the value of -a steady administration will be most disposed to prize a -provision which connects the official existence of public -men with the approbation or disapprobation of that body -which, from the greater permanency of its own composition, -will in all probability be less subject to inconstancy -than any other member of the government. - To this union of the Senate with the President, in the -article of appointments, it has in some cases been suggested -that it would serve to give the President an undue -influence over the Senate, and in others that it would -have an opposite tendency - a strong proof that neither -suggestion is true. - To state the first in its proper form is to refute it. It -amounts to this: the President would have an improper -influence over the Senate, because the Senate would -have the power of restraining him. This is an absurdity in -terms. It cannot admit of a doubt that the entire power -of appointment would enable him much more effectually -to establish a dangerous empire over that body than a -mere power of nomination subject to their control. - Let us take a view of the converse of the proposition: -"the Senate would influence the executive." As I have -had occasion to remark in several other instances, the indistinctness -of the objection forbids a precise answer. In -what manner is this influence to be exerted? In relation -to what objects? The power of influencing a person, in -the sense in which it is here used, must imply a power of -conferring a benefit upon him. How could the Senate -confer a benefit upon the President by the manner of employing -their right of negative upon his nominations? If it -be said they might sometimes gratify him by an acquiescence -in a favorite choice, when public motives might dictate a -different conduct, I answer that the instances in which the -President could be personally interested in the result would -be too few to admit of his being materially affected by the -#create memo2 -compliances of the Senate. Besides this, it is evident that -the POWER which can originate the disposition of honors -and emoluments is more likely to attract than to be attracted -by the POWER which can merely obstruct their -course. If by influencing the President be want restraining -him, this is precisely what must have been intended. -And it has been shown that the restraint would be salutary, -at the same time that it would not be such as to -destroy a single advantage to be looked for from the uncontrolled -agency of that magistrate. The right of nomination -would produce all the good, without the ill. - Upon a comparison of the plan for the appointment of -the officers of the proposed government with that which -is established by the constitution of this State, a decided -preference must be given to the former. In that plan the -power of nomination is unequivocally vested in the executive. -And as there would be a necessity for submitting -each nomination to the judgment of an entire branch of -the legislature, the circumstances attending an appointment, -from the mode of conducting it, would naturally -become matters of notoriety, and the public would -be at no loss to determine what part had been performed -by the different actors. The blame of a bad nomination -would fall upon the President singly and absolutely. The -censure of rejecting a good one would lie entirely at the -door of the senate, aggravated by the consideration -of their having counteracted the good intentions of the -executive. If an ill appointment should be made, the executive, -for nominating, and the Senate, for approving, -would participate, though in different degrees, in the -opprobrium and disgrace. - The reverse of all this characterizes the manner of appointment -in this State. The council of appointment consists -of from three to five persons, of whom the governor -is always one. This small body, shut up in a private -apartment, impenetrable to the public eye, proceed to the -execution of the trust committed to them. It is known -that the governor claims the right of nomination upon -the strength of some ambiguous expressions in the Constitution; -but it is not known to what extent, or in what -manner he exercises it; nor upon what occasions he is -contradicted or opposed. The censure of a bad appointment, -on account of the uncertainty of its author and for -want of a determinate object, has neither poignancy nor -duration. And while an unbounded field for cabal and intrigue -lies open, all idea of responsibility is lost. The -most that the public can know is that the governor -claims the right of nomination; that two out of the inconsiderable -number of four men can too often be managed -without much difficulty; that if some of the members of a -#create memo3 -particular council should happen to be of an uncomplying -character, it is frequently not impossible to get rid of their -opposition by regulating the times of meeting in such a -manner as to render their attendance inconvenient; and -that from whatever cause it may proceed, a great -number of very improper appointments are from time to -time made. Whether a governor of this State avails himself -of the ascendant, he must necessarily have in this -delicate and important part of the administration to prefer -to offices men who are best qualified for them; or -whether he prostitutes that advantage to the advancement -of persons whose chief merit is their implicit devotion to -his will and to the support of a despicable and dangerous -system of personal influence are questions which, unfortunately -for the community, can only be the subjects -of speculation and conjecture. - Every mere council of appointment, however constituted, -will be a conclave in which cabal and intrigue will -have their full scope. Their number, without an unwarrantable -increase of expense, cannot be large enough to -preclude a facility of combination. And as each member -will have his friends and connections to provide for, -the desire of mutual gratification will beget a scandalous -bartering of votes and bargaining for places. The private -attachments of one man might easily be satisfied, but to -satisfy the private attachments of a dozen, or of twenty -men, would occasion a monopoly of all the principal employments -of the government in a few families and -would lead more directly to an aristocracy or an oligarchy -than any measure that could be contrived. If, to avoid an -accumulation of offices, there was to be a frequent change -in the persons who were to be a frequent change -in the persons who were to compose the council, this -would involve the mischiefs of a mutable administration -in their full extent. Such a council would also be more -liable to executive influence than the Senate, because -they would be fewer in number, and would act less immediately -under the public inspection. Such a council, in -fine, as a substitute for the plan of the convention, would -be productive of an increase of expense, a multiplication -of the evils which spring from favoritism and intrigue in -the distribution of public honors, a decrease of stability -in the administration of the government, and a diminution -of the security against an undue influence of the -executive. And yet such a council has been warmly contended -for as an essential amendment in the proposed -Constitution. - I could not with propriety conclude my observations -on the subject of appointments without taking notice of -a scheme for which there have appeared some, though -#create memo4 -but a few advocates; I mean that of uniting the House of -Representatives in the power of making them. I shall, -however, do little more than mention it, as I cannot -imagine that it is likely to gain the countenance of any -considerable part of the community. A body so fluctuating -and at the same time so numerous can never be -deemed proper for the exercise of that power. Its unfitness -will appear manifest to all when it is recollected that -in half a century it may consist of three or four hundred -persons. All the advantages of the stability, both of the -Executive and of the Senate, would be defeated by this -union, and infinite delays and embarrassments would be -occasioned. The exampled of most of the States in their -local constitutions encourages us to reprobate the idea. - The only remaining powers of the executive are comprehended -in giving information to Congress of the state -of the Union; in recommending to their consideration -such measures as he shall judge expedient; in convening -them, or either branch, upon extraordinary occasions; in -adjourning them when they cannot themselves agree upon -the time of adjournment; in receiving ambassadors and -other public ministers; in faithfully executing the laws; -and in commissioning all the officers of the United States. - Except some cavils about the power of convening either -house of the legislature, and that of receiving ambassadors, -no objection has been made to this class of -authorities; nor could they possibly admit of any. It required, -indeed, an insatiable avidity for censure to invent -exceptions to the parts which have been excepted to. In -regard to the power of convening either house of the legislature -I shall barely remark that in respect to the Senate, -at least, we can readily discover a good reason for it. As -this body has a concurrent power with the executive in -the article of treaties, it might often be necessary to call -it together with a view to this object, when it would be -unnecessary and improper to convene the House of Representatives. -As to the reception of ambassadors, what I -have said in a former paper will furnish a sufficient answer. - We have now completed a survy of the structure and -powers of the executive department which, I have endeavored -to show, combines, as far as republican principles -will admit, all the requisites to energy. The -remaining inquiry is: does it also combine the requisites -to safety, in the republican sense - due dependence on -the people, a due responsibility? The answer to this question -has been anticipated in the investigation of its other -characteristics, and is satisfactorily deducible from these -circumstances; the election of the President once in four -years by persons immediately chosen by the people for -that purpose, and his being at all times liable to impeachment, -trial, dismission from office, incapacity to serve -in any other, and to the forfeiture of life and estate by subsequent -prosecution in the common course of law. But -these precautions, great as they are, are not the only -ones which the plan of the convention has provided in -favor of the public security. In the only instances in which -the abuse of the executive authority was materially to be -feared, the chief Magistrate of the United States, would, -by that plan, be subjected to the control of a branch of -the legislative body. What more can an enlightened and -reasonable people desire? -#copyin -#user -#uncopyin -#match survy -#log -#next -1.1b 10 diff --git a/usr.bin/learn/lib/morefiles/L1.1b b/usr.bin/learn/lib/morefiles/L1.1b deleted file mode 100644 index 19d8f1ccd67..00000000000 --- a/usr.bin/learn/lib/morefiles/L1.1b +++ /dev/null @@ -1,242 +0,0 @@ -#print -Now that you know what word is wrong, you still have to find -it in one of the memo files so you can correct it. One way -is to use the text editor "ed", but that is rather slow. Better -is to use the pattern-finding program "grep", which looks through -a set of files to find a particular word. To find all occurrences -of "glop" in the files tom, dick and harry, you need only type - - grep 'glop' tom dick harry - -The first thing is the word that grep is to search for; -any remaining names are file names, which are searched in order. -The quotes around the word to be searched for aren't -always necessary, but it's a good habit to use them -anyway. Later on we'll see some examples where they are really -needed. - -Use grep to find the memo file that contains the spelling error, -and type "answer name", where "name" is the file you decide on. -#create memo1 -(This comes from a federalist paper by alexander hamilton.) - It has been mentioned as one of the advantages to be expected -from the cooperation of the Senate, in the business -of appointments, that it would contribute to the -stability of the administration. The consent of that body -would be necessary to displace as well as to appoint. A -change of the Chief Magistrate, therefore, would not occasion -so violent or so general a revolution in the officers -of the government as might be expected if he were the -sole disposer of offices. Where a man in any station had -given satisfactory evidence of his fitness for it, a new -President would be restrained from attempting a change -in favor of a person more agreeable to him by the apprehension -that a discountenance of the Senate might frustrate -the attempt, and bring some degree of discredit -upon himself. Those who can best estimate the value of -a steady administration will be most disposed to prize a -provision which connects the official existence of public -men with the approbation or disapprobation of that body -which, from the greater permanency of its own composition, -will in all probability be less subject to inconstancy -than any other member of the government. - To this union of the Senate with the President, in the -article of appointments, it has in some cases been suggested -that it would serve to give the President an undue -influence over the Senate, and in others that it would -have an opposite tendency - a strong proof that neither -suggestion is true. - To state the first in its proper form is to refute it. It -amounts to this: the President would have an improper -influence over the Senate, because the Senate would -have the power of restraining him. This is an absurdity in -terms. It cannot admit of a doubt that the entire power -of appointment would enable him much more effectually -to establish a dangerous empire over that body than a -mere power of nomination subject to their control. - Let us take a view of the converse of the proposition: -"the Senate would influence the executive." As I have -had occasion to remark in several other instances, the indistinctness -of the objection forbids a precise answer. In -what manner is this influence to be exerted? In relation -to what objects? The power of influencing a person, in -the sense in which it is here used, must imply a power of -conferring a benefit upon him. How could the Senate -confer a benefit upon the President by the manner of employing -their right of negative upon his nominations? If it -be said they might sometimes gratify him by an acquiescence -in a favorite choice, when public motives might dictate a -different conduct, I answer that the instances in which the -President could be personally interested in the result would -be too few to admit of his being materially affected by the -#create memo2 -compliances of the Senate. Besides this, it is evident that -the POWER which can originate the disposition of honors -and emoluments is more likely to attract than to be attracted -by the POWER which can merely obstruct their -course. If by influencing the President be want restraining -him, this is precisely what must have been intended. -And it has been shown that the restraint would be salutary, -at the same time that it would not be such as to -destroy a single advantage to be looked for from the uncontrolled -agency of that magistrate. The right of nomination -would produce all the good, without the ill. - Upon a comparison of the plan for the appointment of -the officers of the proposed government with that which -is established by the constitution of this State, a decided -preference must be given to the former. In that plan the -power of nomination is unequivocally vested in the executive. -And as there would be a necessity for submitting -each nomination to the judgment of an entire branch of -the legislature, the circumstances attending an appointment, -from the mode of conducting it, would naturally -become matters of notoriety, and the public would -be at no loss to determine what part had been performed -by the different actors. The blame of a bad nomination -would fall upon the President singly and absolutely. The -censure of rejecting a good one would lie entirely at the -door of the senate, aggravated by the consideration -of their having counteracted the good intentions of the -executive. If an ill appointment should be made, the executive, -for nominating, and the Senate, for approving, -would participate, though in different degrees, in the -opprobrium and disgrace. - The reverse of all this characterizes the manner of appointment -in this State. The council of appointment consists -of from three to five persons, of whom the governor -is always one. This small body, shut up in a private -apartment, impenetrable to the public eye, proceed to the -execution of the trust committed to them. It is known -that the governor claims the right of nomination upon -the strength of some ambiguous expressions in the Constitution; -but it is not known to what extent, or in what -manner he exercises it; nor upon what occasions he is -contradicted or opposed. The censure of a bad appointment, -on account of the uncertainty of its author and for -want of a determinate object, has neither poignancy nor -duration. And while an unbounded field for cabal and intrigue -lies open, all idea of responsibility is lost. The -most that the public can know is that the governor -claims the right of nomination; that two out of the inconsiderable -number of four men can too often be managed -without much difficulty; that if some of the members of a -#create memo3 -particular council should happen to be of an uncomplying -character, it is frequently not impossible to get rid of their -opposition by regulating the times of meeting in such a -manner as to render their attendance inconvenient; and -that from whatever cause it may proceed, a great -number of very improper appointments are from time to -time made. Whether a governor of this State avails himself -of the ascendant, he must necessarily have in this -delicate and important part of the administration to prefer -to offices men who are best qualified for them; or -whether he prostitutes that advantage to the advancement -of persons whose chief merit is their implicit devotion to -his will and to the support of a despicable and dangerous -system of personal influence are questions which, unfortunately -for the community, can only be the subjects -of speculation and conjecture. - Every mere council of appointment, however constituted, -will be a conclave in which cabal and intrigue will -have their full scope. Their number, without an unwarrantable -increase of expense, cannot be large enough to -preclude a facility of combination. And as each member -will have his friends and connections to provide for, -the desire of mutual gratification will beget a scandalous -bartering of votes and bargaining for places. The private -attachments of one man might easily be satisfied, but to -satisfy the private attachments of a dozen, or of twenty -men, would occasion a monopoly of all the principal employments -of the government in a few families and -would lead more directly to an aristocracy or an oligarchy -than any measure that could be contrived. If, to avoid an -accumulation of offices, there was to be a frequent change -in the persons who were to be a frequent change -in the persons who were to compose the council, this -would involve the mischiefs of a mutable administration -in their full extent. Such a council would also be more -liable to executive influence than the Senate, because -they would be fewer in number, and would act less immediately -under the public inspection. Such a council, in -fine, as a substitute for the plan of the convention, would -be productive of an increase of expense, a multiplication -of the evils which spring from favoritism and intrigue in -the distribution of public honors, a decrease of stability -in the administration of the government, and a diminution -of the security against an undue influence of the -executive. And yet such a council has been warmly contended -for as an essential amendment in the proposed -Constitution. - I could not with propriety conclude my observations -on the subject of appointments without taking notice of -a scheme for which there have appeared some, though -#create memo4 -but a few advocates; I mean that of uniting the House of -Representatives in the power of making them. I shall, -however, do little more than mention it, as I cannot -imagine that it is likely to gain the countenance of any -considerable part of the community. A body so fluctuating -and at the same time so numerous can never be -deemed proper for the exercise of that power. Its unfitness -will appear manifest to all when it is recollected that -in half a century it may consist of three or four hundred -persons. All the advantages of the stability, both of the -Executive and of the Senate, would be defeated by this -union, and infinite delays and embarrassments would be -occasioned. The exampled of most of the States in their -local constitutions encourages us to reprobate the idea. - The only remaining powers of the executive are comprehended -in giving information to Congress of the state -of the Union; in recommending to their consideration -such measures as he shall judge expedient; in convening -them, or either branch, upon extraordinary occasions; in -adjourning them when they cannot themselves agree upon -the time of adjournment; in receiving ambassadors and -other public ministers; in faithfully executing the laws; -and in commissioning all the officers of the United States. - Except some cavils about the power of convening either -house of the legislature, and that of receiving ambassadors, -no objection has been made to this class of -authorities; nor could they possibly admit of any. It required, -indeed, an insatiable avidity for censure to invent -exceptions to the parts which have been excepted to. In -regard to the power of convening either house of the legislature -I shall barely remark that in respect to the Senate, -at least, we can readily discover a good reason for it. As -this body has a concurrent power with the executive in -the article of treaties, it might often be necessary to call -it together with a view to this object, when it would be -unnecessary and improper to convene the House of Representatives. -As to the reception of ambassadors, what I -have said in a former paper will furnish a sufficient answer. - We have now completed a survy of the structure and -powers of the executive department which, I have endeavored -to show, combines, as far as republican principles -will admit, all the requisites to energy. The -remaining inquiry is: does it also combine the requisites -to safety, in the republican sense - due dependence on -the people, a due responsibility? The answer to this question -has been anticipated in the investigation of its other -characteristics, and is satisfactorily deducible from these -circumstances; the election of the President once in four -years by persons immediately chosen by the people for -that purpose, and his being at all times liable to impeachment, -trial, dismission from office, incapacity to serve -in any other, and to the forfeiture of life and estate by subsequent -prosecution in the common course of law. But -these precautions, great as they are, are not the only -ones which the plan of the convention has provided in -favor of the public security. In the only instances in which -the abuse of the executive authority was materially to be -feared, the chief Magistrate of the United States, would, -by that plan, be subjected to the control of a branch of -the legislative body. What more can an enlightened and -reasonable people desire? -#copyin -#user -#uncopyin -#match memo4 -#log -#next -1.1c 10 diff --git a/usr.bin/learn/lib/morefiles/L1.1c b/usr.bin/learn/lib/morefiles/L1.1c deleted file mode 100644 index 377c8fe996e..00000000000 --- a/usr.bin/learn/lib/morefiles/L1.1c +++ /dev/null @@ -1,18 +0,0 @@ -#print -In this directory is a file named for an unsuccessful king. -Read it and do what it tells you. -#create Elizabeth1 -1. She was not a king -2. She was generally successful -#create George3 -Does the file George3 contain a backspace character -any where in it? Figure it out with grep, then type -"answer N", where N is the line number where you found it. -Type "answer 0" if there is no backspace. -#copyin -#user -#uncopyin -#match 2 -#log -#next -1.1d 10 diff --git a/usr.bin/learn/lib/morefiles/L1.1d b/usr.bin/learn/lib/morefiles/L1.1d deleted file mode 100644 index a17ece4fc15..00000000000 --- a/usr.bin/learn/lib/morefiles/L1.1d +++ /dev/null @@ -1,80 +0,0 @@ -#print -Suppose you want to print all lines in the file "memo" -that contain a question mark "?". Since the question mark -is an abbreviation character (as in "ls ?"), you -have to make sure that the command interpreter doesn't -try to interpret it, but instead passes it to "grep" -as a literal question mark. - -The way to do this is simply to enclose it in quotes, -as in - grep '?' files... - -Use "grep" to find all the lines with question marks, -then type "ready". -#create memo -(This comes from a federalist paper by alexander hamilton.) - It has been mentioned as one of the advantages to be expected -from the cooperation of the Senate, in the business -of appointments, that it would contribute to the -stability of the administration. The consent of that body -would be necessary to displace as well as to appoint. A -change of the Chief Magistrate, therefore, would not occasion -so violent or so general a revolution in the officers -of the government as might be expected if he were the -sole disposer of offices. Where a man in any station had -given satisfactory evidence of his fitness for it, a new -President would be restrained from attempting a change -in favor of a person more agreeable to him by the apprehension -that a discountenance of the Senate might frustrate -the attempt, and bring some degree of discredit -upon himself. Those who can best estimate the value of -a steady administration will be most disposed to prize a -provision which connects the official existence of public -men with the approbation or disapprobation of that body -which, from the greater permanency of its own composition, -will in all probability be less subject to inconstancy -than any other member of the government. - To this union of the Senate with the President, in the -article of appointments, it has in some cases been suggested -that it would serve to give the President an undue -influence over the Senate, and in others that it would -have an opposite tendency - a strong proof that neither -suggestion is true. - To state the first in its proper form is to refute it. It -amounts to this: the President would have an improper -influence over the Senate, because the Senate would -have the power of restraining him. This is an absurdity in -terms. It cannot admit of a doubt that the entire power -of appointment would enable him much more effectually -to establish a dangerous empire over that body than a -mere power of nomination subject to their control. - Let us take a view of the converse of the proposition: -"the Senate would influence the executive." As I have -had occasion to remark in several other instances, the indistinctness -of the objection forbids a precise answer. In -what manner is this influence to be exerted? In relation -to what objects? The power of influencing a person, in -the sense in which it is here used, must imply a power of -conferring a benefit upon him. How could the Senate -confer a benefit upon the President by the manner of employing -their right of negative upon his nominations? If it -be said they might sometimes gratify him by an acquiescence -in a favorite choice, when public motives might dictate a -different conduct, I answer that the instances in which the -President could be personally interested in the result would -be too few to admit of his being materially affected by the -#create Ref -what manner is this influence to be exerted? In relation -to what objects? The power of influencing a person, in -their right of negative upon his nominations? If it -#create 1 -#create x -#copyout -#user -#uncopyout -tail -3 .ocopy >X1 -#cmp X1 Ref -#log -#next -2.1a 10 diff --git a/usr.bin/learn/lib/morefiles/L2.1a b/usr.bin/learn/lib/morefiles/L2.1a deleted file mode 100644 index d380e8adf25..00000000000 --- a/usr.bin/learn/lib/morefiles/L2.1a +++ /dev/null @@ -1,32 +0,0 @@ -#print -Most of the programs we have studied so far produce their -output on the terminal -- examples are "ls", "spell", "grep", -"date", "who", and so on. (Of course, some do not, like -"mv", "cp", and "rm".) In any case, it is sometimes useful -to be able to capture the output of a program in a file, -so it can be used in some later processing. This is very easy. -For example, to get the current date and time in a file called -"now", you need only type - - date >now - -The symbol ">" tells the command interpreter that output -is to go into the file whose name follows. If the file already -exists, its old contents will be clobbered, so use discretion. - -Your task is to make a list of the files in this directory -in the file "foo". -When you have finished, type "ready". -#create X1 -#create junk -#create glop -#create junk1 -asdfadfaf -#create junk2 -qerqerqrq -#user -ls >X1 -#cmp X1 foo -#log -#next -2.1b 10 diff --git a/usr.bin/learn/lib/morefiles/L2.1b b/usr.bin/learn/lib/morefiles/L2.1b deleted file mode 100644 index 5689e9521b0..00000000000 --- a/usr.bin/learn/lib/morefiles/L2.1b +++ /dev/null @@ -1,18 +0,0 @@ -#print -Now make a list of the files in this directory whose -names begin with "t" in the file "foo". -Type "ready" when you are done. -#create X1 -#create foo -#create this -#create Ref -that -theother -this -#create that -#create theother -#user -#cmp foo Ref -#log -#next -2.1c 10 diff --git a/usr.bin/learn/lib/morefiles/L2.1c b/usr.bin/learn/lib/morefiles/L2.1c deleted file mode 100644 index d1ff869df7e..00000000000 --- a/usr.bin/learn/lib/morefiles/L2.1c +++ /dev/null @@ -1,17 +0,0 @@ -#print -This time you have to get a list of the files whose names begin -with "memo", but sorted in order of last change, most recent first, -as produced by "ls -t". Get the list in file "gorp", -then type "ready". -#create memo1 -first line -#create memo3 -third line -#create memo2 -second line -#user -ls -t memo* >X1 -#cmp X1 gorp -#log -#next -2.1d 10 diff --git a/usr.bin/learn/lib/morefiles/L2.1d b/usr.bin/learn/lib/morefiles/L2.1d deleted file mode 100644 index 97ef3914494..00000000000 --- a/usr.bin/learn/lib/morefiles/L2.1d +++ /dev/null @@ -1,10 +0,0 @@ -#print -If you type "ls >list", does the name "list" appear in the file -called "list"? Figure it out, then type yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -2.1e 10 diff --git a/usr.bin/learn/lib/morefiles/L2.1e b/usr.bin/learn/lib/morefiles/L2.1e deleted file mode 100644 index 6eef8461cd4..00000000000 --- a/usr.bin/learn/lib/morefiles/L2.1e +++ /dev/null @@ -1,25 +0,0 @@ -#print -If you make a mistake and type something like - - xxxxx >precious - -where "xxxxx" is not___ the name of a legal UNIX -command, what happens to the file "precious"? - -In this directory, there are several precious files. -Experiment to see what happens. When you have decided, -type "answer harmless" if nothing happens to the files, -or "answer disaster" if the file is clobbered. -#create precious -I am precious. -#create precious1 -So am I. -#create precious2 -Me too. -#copyin -#user -#uncopyin -#match disaster -#log -#next -2.1f 10 diff --git a/usr.bin/learn/lib/morefiles/L2.1f b/usr.bin/learn/lib/morefiles/L2.1f deleted file mode 100644 index f25c69ea158..00000000000 --- a/usr.bin/learn/lib/morefiles/L2.1f +++ /dev/null @@ -1,17 +0,0 @@ -#print -Obtain a long listing (with "ls -l") of all files in this directory -whose names begin with capital letters, in a file -called "names". -Type "ready" when you're done. -#create STUFF -#create Nonsense -this is junk -#create abc -#create def -# -ls -l [A-Z]* >x1 -#user -#cmp x1 names -#log -#next -3.1a 10 diff --git a/usr.bin/learn/lib/morefiles/L3.1a b/usr.bin/learn/lib/morefiles/L3.1a deleted file mode 100644 index a2f8bac16ba..00000000000 --- a/usr.bin/learn/lib/morefiles/L3.1a +++ /dev/null @@ -1,36 +0,0 @@ -#print -The notation ">" can be used by most programs to capture -output on a file. For example, - - cat henry >james - -makes a copy of "henry" in the file "james"; in fact this is -essentially identical to - - cp henry james - -"cat" is a bit more flexible, though, since you can concatenate -several files onto one output. Remember that - - cat tom dick harry - -copies all three files onto the terminal? -In this directory is a file named "john". -Make a file called "mary" that contains ___two copies of "john". -Type "ready" when you're done. -#create john -Now is the time for all good -men to come to the aid of their -party -#create X1 -Now is the time for all good -men to come to the aid of their -party -Now is the time for all good -men to come to the aid of their -party -#user -#cmp X1 mary -#log -#next -3.1b 10 diff --git a/usr.bin/learn/lib/morefiles/L3.1b b/usr.bin/learn/lib/morefiles/L3.1b deleted file mode 100644 index e48cc813a92..00000000000 --- a/usr.bin/learn/lib/morefiles/L3.1b +++ /dev/null @@ -1,40 +0,0 @@ -#print -How many spelling mistakes are there in the file "Ref", -according to "spell"? -Type "answer N", where N is the number you decide on. -#create Ref -Bianchi -Blue -Feldman -McIlroy -Roome -Rosin -Rosler -Aho -Bourne -Dvorak -Haley -Harris -Holt -Johnson -Mashey -Mitze -Muha -Nelson -Pinson -Plauger -Spivack -Thompson -Weinberger -Lesk -Ossanna -# -spell Ref | %s/../lcount >X2 & -#copyin -#user -#uncopyin -tail -1 .copy >X1 -#cmp X2 X1 -#log -#next -3.1c 10 diff --git a/usr.bin/learn/lib/morefiles/L3.1c b/usr.bin/learn/lib/morefiles/L3.1c deleted file mode 100644 index 31f5635be99..00000000000 --- a/usr.bin/learn/lib/morefiles/L3.1c +++ /dev/null @@ -1,42 +0,0 @@ -#print -So far the only printing program we have seen -is "cat", which just copies one or more files -onto the terminal (or perhaps onto a file when used -with ">"). -The next step up is the program "pr", which -prints files so that each file begins on a -new page, and the top of each page contains the date -and time the file was changed, and a running page number. -Use a single "pr" to print the two files in this directory -whose names begin with "fed". -What page number is printed on the last page? Type "answer N" -where N is the page number. -#create fed1 - After an unequivocal experience of the inefficacy of -the subsisting federal government, you are called upon to -deliberate on a new Constitution for the United States -of America. The subject speaks its own importance; -comprehending in its consequences nothing less than the -existence of the union, the safety and welfare of the -parts of which it is composed, the fate of an empire in many -respects the most interesting in the world. -#create fed2 -It has been frequently remarked that it seems to have been -reserved to the people of this country, by their conduct and -example, to decide the important question, whether -societies of men are really capable or not of establishing -good government from reflection and choice, or whether -they are forever destined to depend for their political -constitutions on accident and force. If there be any truth -in the remark, the crisis at which we are arrived may with -propriety be regarded as the era in which that -decision is to be made; and a wrong election of the part -we shall act may, in this view, deserve to be considered as -the general misfortune of mankind. -#copyin -#user -#uncopyin -#match 1 -#log -#next -3.1d diff --git a/usr.bin/learn/lib/morefiles/L3.1d b/usr.bin/learn/lib/morefiles/L3.1d deleted file mode 100644 index 1f7654c1ecc..00000000000 --- a/usr.bin/learn/lib/morefiles/L3.1d +++ /dev/null @@ -1,134 +0,0 @@ -#print -The pr command has a number of other capabilities besides simple -printing of files. Probably the most useful is that it can do -multi-column printing. This is controlled by an optional -argument: - pr -3 filenames -will print in 3-column format, and - pr -5 filenames -prints in five columns. You can use any number in place of 3 and 5, -although as you get more columns they become narrower -so things will fit. -Notice that the optional argument comes ______before the files names. - -In this directory there is a list of words. Find the list, print -it in two columns, and find out what word appears at the top -of the second column. Type "answer WORD", where WORD -is the word you decide on. -#create wordlist -a -aardvark -aardwolf -Aaron -Aaronic -Ab -aba -abaca -abaci -aback -abacus -abacuses -abaft -abalone -abandon -abandoned -abandoner -abandonment -abase -abasement -abash -abashment -abate -abatement -abater -abatis -abatises -abattoir -abaxial -abbacy -Abbasid -abbatial -abbe' -abbess -Abbevillian -abbey -abbot -abbreviate -abbreviation -abbreviator -Abby -Abc -Abcs -Abc's -abdicable -abdicate -abdication -abdicator -abdomen -abdominal -abdominally -abdominous -abduce -abducent -abduct -abduction -abductor -abeam -abecedarian -abed -Abel -abele -abelmosk -aberrance -aberrancy -aberrant -aberrantly -aberration -aberrational -abet -abetment -abetted -abetter -abetting -abettor -abeyance -abeyant -abhominable -abhor -abhorred -abhorrence -abhorrent -abhorrently -abhorrer -abhorring -Abib -abidance -abide -abided -abider -abiding -Abigail -abigail -ability -abiogeneses -abiogenesis -abiogenetic -abiogenetical -abiogenetically -abiogenist -#copyin -#user -#uncopyin -#create script -/^a/s/.* // -.w X1 -w -q -# -pr -2 wordlist >foo -ed - foo <script -tail -1 .copy >X2 -#cmp X1 X2 -#log -#next -3.1e 10 diff --git a/usr.bin/learn/lib/morefiles/L3.1e b/usr.bin/learn/lib/morefiles/L3.1e deleted file mode 100644 index 36f55d530b3..00000000000 --- a/usr.bin/learn/lib/morefiles/L3.1e +++ /dev/null @@ -1,116 +0,0 @@ -#print -Of course you can collect the output from "pr" in a file, -just as you can with "cat". For practice, there are several -files in this directory whose names begin with "word". -Prepare a list (with "pr", one file per page) -of these files in the file "neat". -Type "ready" when you have finished. -#create word1 -a -aard-vark -aard-wolf -Aar-on -Aa-ron-ic -Ab -aba -ab-a-ca -aba-ci -aback -aba-cus -aba-cus-es -abaft -ab-a-lo-ne -aban-don -aban-doned -aban-don-er -aban-don-ment -abase -abase-ment -abash -abash-ment -abate -abate-ment -abat-er -ab-a-tis -ab-a-tis-es -ab-at-toir -ab-ax-i-al -ab-ba-cy -#create word2 -Ab-bas-id -ab-ba-tial -ab-be' -ab-bess -Abbe-vil-li-an -ab-bey -ab-bot -ab-bre-vi-ate -ab-bre-vi-a-tion -ab-bre-vi-a-tor -Abby -Abc -Abcs -Abc's -ab-di-ca-ble -ab-di-cate -ab-di-ca-tion -ab-di-ca-tor -ab-do-men -ab-dom-i-nal -ab-dom-i-nal-ly -ab-dom-i-nous -ab-duce -ab-du-cent -ab-duct -ab-duc-tion -ab-duc-tor -abeam -abe-ce-dar-i-an -abed -#create word3 -Abel -abele -abel-mosk -ab-er-rance -ab-er-ran-cy -ab-er-rant -ab-er-rant-ly -ab-er-ra-tion -ab-er-ra-tion-al -abet -abet-ment -abet-ted -abet-ter -abet-ting -abet-tor -abey-ance -abey-ant -abhominable -ab-hor -ab-horred -ab-hor-rence -ab-hor-rent -ab-hor-rent-ly -ab-hor-rer -ab-hor-ring -Abib -abid-ance -abide -abid-ed -abid-er -abid-ing -Abigail -ab-i-gail -abil-i-ty -abio-gen-e-ses -abio-gen-e-sis -abio-ge-net-ic -abio-ge-net-i-cal -abio-ge-net-i-cal-ly -abi-og-e-nist -#user -pr word* >X1 -#cmp X1 neat -#log -#next -3.1f 10 diff --git a/usr.bin/learn/lib/morefiles/L3.1f b/usr.bin/learn/lib/morefiles/L3.1f deleted file mode 100644 index 06768ea3506..00000000000 --- a/usr.bin/learn/lib/morefiles/L3.1f +++ /dev/null @@ -1,16 +0,0 @@ -#print -In this directory there are two files whose names -begin with "r". Copy them onto a new file called -"combine". Type "ready" when you're done. -#create ref -Now is the tuime -#create ref1 -for all good men -#create X1 -Now is the tuime -for all good men -#user -#cmp X1 combine -#log -#next -3.1g 10 diff --git a/usr.bin/learn/lib/morefiles/L3.1g b/usr.bin/learn/lib/morefiles/L3.1g deleted file mode 100644 index 12921ea46b6..00000000000 --- a/usr.bin/learn/lib/morefiles/L3.1g +++ /dev/null @@ -1,167 +0,0 @@ -#print -This exercise combines several things you've learned already. -In this directory is a file containing a list of words. -Collect all of the words that contain "ly" into a file -called "lywords". (What program does that?) -Then use "pr" to make another file called "neatly" -that contains the list of words printed in one column. -Type "ready" when you have made both files. -#create words -ampersand -amphetamine -amphiarthrosis -amphibia -amphibian -amphibiotic -amphibious -amphibiously -amphibiousness -amphibole -amphibolite -amphibolitic -amphibology -amphibrach -amphibrachic -amphictyonic -amphictyony -amphidiploid -amphidiploidy -amphimacer -amphimictic -amphimictically -amphimixis -Amphion -amphioxus -amphiploid -amphiploidy -amphipod -amphiprostyle -amphiprostyle -amphisbaena -amphisbaenic -amphistylar -amphitheater -amphitheatric -amphitheatrical -amphitheatrically -Amphitrite -amphitropous -Amphitryon -amphora -amphorae -amphoras -amphoteric -ample -ampleness -amplexicaul -amplidyne -amplification -amplifier -amplify -amplitude -amply -ampoule -ampul -ampulla -ampullae -ampullar -amputate -amputation -amputator -amputee -amtrac -amtrack -amuck -amulet -amuse -amusement -amuser -amusing -amusingly -amusive -Amy -amygdalin -amygdaloid -amygdaloidal -amyl -amylaceous -amylase -amyloid -amyloidal -amylolysis -amylolytic -amylopsin -amylose -amylum -amyotonia -an -an' -ana -an'a -anabaptism -Anabaptist -anabases -anabasis -anabatic -anabiosis -anabiotic -anabolic -anabolism -anabolite -anabolitic -anachronic -anachronism -anachronistic -anachronistically -anachronous -anachronously -anaclitic -anacolutha -anacoluthic -anacoluthically -anacoluthon -anacoluthons -anaconda -Anacreontic -anacreontic -anacrusis -anaculture -anadem -anadiplosis -anadromous -anaemia -anaerobe -anaerobic -anaerobically -anaesthesia -anaesthetic -anaglyph -anaglyphic -anagoge -anagogic -anagogical -anagogically -anagogy -anagram -anagrammatic -anagrammatical -anagrammatically -anagrammatize -anagrammed -anagramming -anal -analcime -analcite -analects -analemma -analeptic -analgesia -analgesic -analgetic -#user -grep ly words >X1 -pr lywords >X2 -cmp -s X1 lywords && cmp -s X2 neatly -#log -#next -4.1a 10 diff --git a/usr.bin/learn/lib/morefiles/L4.1a b/usr.bin/learn/lib/morefiles/L4.1a deleted file mode 100644 index 6cd5ba5e8b1..00000000000 --- a/usr.bin/learn/lib/morefiles/L4.1a +++ /dev/null @@ -1,25 +0,0 @@ -#print -You have already had some practice in using ">" to capture -the output of a program. In much the same way, it -is possible to arrange for a program to take its input not -from the terminal but from a file. -Most UNIX programs are written so that they will read either -the terminal or from a list of filenames. -To have a program read from a file instead of the terminal, -use the "<", like this: - pr <file -As a simple experiment, determine if - pr <file -is absolutely identical to - pr file -Answer yes or no. -#create junk -you can use this file to play with. -#copyin -#user -#uncopyin -#match no -#log -#next -4.1b 10 -4.2a 5 diff --git a/usr.bin/learn/lib/morefiles/L4.1b b/usr.bin/learn/lib/morefiles/L4.1b deleted file mode 100644 index 26a8076de64..00000000000 --- a/usr.bin/learn/lib/morefiles/L4.1b +++ /dev/null @@ -1,38 +0,0 @@ -#print -Is there a difference between - grep the memo[12] -and - cat memo[12] >temp - grep the <temp -Answer yes or no. - -If you want to experiment, there are two files named "memo1" and -"memo2" in this directory. -#create memo1 - There is not room enough in the leaves to hold all the food -that plants make. Much of the food has to be stored in other parts -of the plant. - We eat the parts of plants where the most food is stored. The -carrot plant stores food in its roots. We eat the roots of carrots. -The celery plant stores food in its leaf stalks. They are the parts -we eat. Many kinds of plants store food in their fruits. We eat -the fruits of these plants to get the stored food in them. - Some kinds of plants have ways of protecting their stored food. -#create memo2 - Goldfish grow very slowly in an aquarium. They grow so slowly -that it is hard to know that they grow at all. If they are kept -outdoors in a pool, they grow much faster and they grow much larger, -too. Sometimes they grow to be more than a foot long in an outdoor -pool. - When goldfish are kept in an aquarium they often do not live very -long. Sometimes they die in a few weeks, but they may live as long -as ten years. Some people have kept goldfish in an outdoor pool for -thirty years. - There are many different colors of goldfish. -#copyin -#user -#uncopyin -#match yes -#log -#next -4.1c 10 diff --git a/usr.bin/learn/lib/morefiles/L4.1c b/usr.bin/learn/lib/morefiles/L4.1c deleted file mode 100644 index d2c7e08cf29..00000000000 --- a/usr.bin/learn/lib/morefiles/L4.1c +++ /dev/null @@ -1,42 +0,0 @@ -#print -There are two files called "story1" and "story2" in -this directory. Collect the outputs of - grep the story[12] -and - cat story[12] >temp - grep the <temp -on two files called "the1" and "the2". Then -run "diff" on "the1" and "the2", and -collect the differences on a file called "difference". -Type "ready" when you have finished all of this. -#create story1 - Some animals have six feet. These animals are insects. -Insects are little animals. Insects creep with their six feet. -Many insects have wings, too. - Ants are insects. Many ants live together. They live in ant -hills. Many ants travel together. Ants creep on their six feet. -Ants creep fast. They creep around on the ground. They creep in -and out of ant hills. They creep up and down plants. They creep -into houses. - Some ants have wings. They do not have wings all the time. -They grow wings to fly away. They fly away to find new homes. -Then they lose their wings. -#create story2 - "Will there be baby robins soon?" asked Bill. "We will see," -said Miss Fox. Joan said, "we have looked and looked. I think -there will be no baby birds." Barbara said, "It takes many days. -The eggs need to be warm all the time. The mother bird warms them." -Bill said, "The father bird helps, too." Joan said, "I guess I did -not think. There may be baby birds after all." - One day Carl called, "Come and look. I see four baby birds in -the nest." All the children ran to look. "But they are not pretty," -Joan said. Bill said, "Joan is right." -#user -cat story[12] >X1 -grep the <X1 >X2 -grep the story[12] >X1 -diff X1 X2 >X3 -#cmp X3 difference -#log -#next -4.1d 10 diff --git a/usr.bin/learn/lib/morefiles/L4.1d b/usr.bin/learn/lib/morefiles/L4.1d deleted file mode 100644 index 8b3cae771b2..00000000000 --- a/usr.bin/learn/lib/morefiles/L4.1d +++ /dev/null @@ -1,130 +0,0 @@ -#print -Unix has several rather simple programs that are useful -in their own right and as building blocks in more complicated -operations. One of the most frequently used is "wc", -which counts lines, words, and characters in files. -If you say - wc file -or - wc <file -wc will print three numbers: the number of -lines, words and characters in the file. -(Some systems have an obsolete version of "wc" that -doesn't count the characters.) -If there is more than one file, as in - wc file1 file2 file3 file4 -then wc will list the counts for each file separately, -and the total. - -What is the total number of words -in the two files whose names begin with "memo"? -Type "answer N", where N is the number of words. -#create memo1 - It has been mentioned as one of the advantages to be expected -from the cooperation of the Senate, in the business -of appointments, that it would contribute to the -stability of the administration. The consent of that body -would be necessary to displace as well as to appoint. A -change of the Chief Magistrate, therefore, would not occasion -so violent or so general a revolution in the officers -of the government as might be expected if he were the -sole disposer of offices. Where a man in any station had -given satisfactory evidence of his fitness for it, a new -President would be restrained from attempting a change -in favor of a person more agreeable to him by the apprehension -that a discountenance of the Senate might frustrate -the attempt, and bring some degree of discredit -upon himself. Those who can best estimate the value of -a steady administration will be most disposed to prize a -provision which connects the official existence of public -men with the approbation or disapprobation of that body -which, from the greater permanency of its own composition, -will in all probability be less subject to inconstancy -than any other member of the government. - To this union of the Senate with the President, in the -article of appointments, it has in some cases been suggested -that it would serve to give the President an undue -influence over the Senate, and in others that it would -have an opposite tendency - a strong proof that neither -suggestion is true. - To state the first in its proper form is to refute it. It -amounts to this: the President would have an improper -influence over the Senate, because the Senate would -have the power of restraining him. This is an absurdity in -terms. It cannot admit of a doubt that the entire power -of appointment would enable him much more effectually -to establish a dangerous empire over that body than a -mere power of nomination subject to their control. - Let us take a view of the converse of the proposition: -"the Senate would influence the executive." As I have -had occasion to remark in several other instances, the indistinctness -of the objection forbids a precise answer. In -what manner is this influence to be exerted? In relation -to what objects? The power of influencing a person, in -the sense in which it is here used, must imply a power of -conferring a benefit upon him. How could the Senate -confer a benefit upon the President by the manner of employing -their right of negative upon his nominations? If it -be said they might sometimes gratify him by an acquiescence -in a favorite choice, when public motives might dictate a -different conduct, I answer that the instances in which the -President could be personally interested in the result would -be too few to admit of his being materially affected by the -#create memo2 -compliances of the Senate. Besides this, it is evident that -the POWER which can originate the disposition of honors -and emoluments is more likely to attract than to be attracted -by the POWER which can merely obstruct their -course. If by influencing the President be want restraining -him, this is precisely what must have been intended. -And it has been shown that the restraint would be salutary, -at the same time that it would not be such as to -destroy a single advantage to be looked for from the uncontrolled -agency of that magistrate. The right of nomination -would produce all the good, without the ill. - Upon a comparison of the plan for the appointment of -the officers of the proposed government with that which -is established by the constitution of this State, a decided -preference must be given to the former. In that plan the -power of nomination is unequivocally vested in the executive. -And as there would be a necessity for submitting -each nomination to the judgment of an entire branch of -the legislature, the circumstances attending an appointment, -from the mode of conducting it, would naturally -become matters of notoriety, and the public would -be at no loss to determine what part had been performed -by the different actors. The blame of a bad nomination -would fall upon the President singly and absolutely. The -censure of rejecting a good one would lie entirely at the -door of the senate, aggravated by the consideration -of their having counteracted the good intentions of the -executive. If an ill appointment should be made, the executive, -for nominating, and the Senate, for approving, -would participate, though in different degrees, in the -opprobrium and disgrace. - The reverse of all this characterizes the manner of appointment -in this State. The council of appointment consists -of from three to five persons, of whom the governor -is always one. This small body, shut up in a private -apartment, impenetrable to the public eye, proceed to the -execution of the trust committed to them. It is known -that the governor claims the right of nomination upon -the strength of some ambiguous expressions in the Constitution; -but it is not known to what extent, or in what -manner he exercises it; nor upon what occasions he is -contradicted or opposed. The censure of a bad appointment, -on account of the uncertainty of its author and for -want of a determinate object, has neither poignancy nor -duration. And while an unbounded field for cabal and intrigue -lies open, all idea of responsibility is lost. The -most that the public can know is that the governor -claims the right of nomination; that two out of the inconsiderable -number of four men can too often be managed -without much difficulty; that if some of the members of a -#copyin -#user -#uncopyin -#match 949 -#log -#next -4.1e 10 diff --git a/usr.bin/learn/lib/morefiles/L4.1e b/usr.bin/learn/lib/morefiles/L4.1e deleted file mode 100644 index 8b794ea4e91..00000000000 --- a/usr.bin/learn/lib/morefiles/L4.1e +++ /dev/null @@ -1,34 +0,0 @@ -#print -How many lines total are there in the two files called -"chema" and "chemb" in this directory? Use "wc". -Type "answer N", where N is the total number of lines. -#create chema - The baker said, "Now I shall put just the right amounts of water and -yeast with the flour that is in the mixer. Flour, water, and yeast -together make the sponge. Making sponge is the first step in making -bread." - The baker closed the mixer. Inside the machine, the flour and -yeast and water went around and around until they were well mixed. -Then the baker opened the mixer and the sponge dropped into a greased -tub called a trough. - The baker pushed the trough into a warm room to let the sponge -rise. It looked like dough, but it did not as yet have everything -in it. -#create chemb - Wash the blackboard. Watch it dry. The water goes into the air. -When water goes into the air it evaporates. - Tie a damp cloth to one end of a stick. Tie a bottle to the -other end. Put water in the bottle until the stick is level. Watch -the stick for a few minutes. It does not stay level. - Water goes into the air when it evaporates. It changes into -water vapor. You cannot see water vapor, but it is in the air all -around you. - Cut a hole in the bottom of a cardboard box. Hold the box -against a cold window and blow into the hole. -#copyin -#user -#uncopyin -#match 21 -#log -#next -4.1f 10 diff --git a/usr.bin/learn/lib/morefiles/L4.1f b/usr.bin/learn/lib/morefiles/L4.1f deleted file mode 100644 index 73ecd923953..00000000000 --- a/usr.bin/learn/lib/morefiles/L4.1f +++ /dev/null @@ -1,48 +0,0 @@ -#print -Another useful command is "tail", which will print the last -10 lines of a file. This is handy when you want to see how -far something got before it stopped, or what the last thing -in a file is. To use "tail", all you need to say is - tail file -What is the first word on the next to last line of the file -called "Ref" in this directory. -Type "answer WORD", where WORD is the word you found. -#create Ref - Now Abraham Lincoln was master of the White House. But he was -President of only part of the United States. For the Southern -States has taken down the Star-Spangled Banner and raised the flag -of the Confederacy in its stead. Sad and silent, Lincoln gazed -through his spyglass at the Confederate flag that fluttered in the -wind on the other side of the Potomac River in Virginia. He pondered -how to get the Southern States back into the Union. He needed -quiet to think what to do. But from morning till night the White -House was crowded with people seeking his help. - About a hundred and fifty years after the pilgrims settled in -this country, a young hunter picked up his gun. He tossed it onto -his shoulder and followed a buffalo trail across the mountains into -what is now Kentucky. - His name was Daniel Boone. - He found wild country. There were no settlers, no roads. Indians -hunted in the woods for food. The country was beautiful and dangerous. -But here was rich, free land -- miles and miles of it. - Many settlers, besides the Pilgrims, had come to the shores of -America. But they had stayed on the safe land between the sea and -the mountains. - Columbus discovered America in 1492. Later, other explorers -visited the new land. They told people in Europe of the forests, -furs, and fish they found. Many Europeans decided to settle in -this wonderful land. But some of the first settlers starved to -death during the hard winters. Others lived to build settlements -or colonies for their mother countries. Colonial America was -beginning. In 1607, three ships brought men from England to what -is now Jamestown, Virginia. They were looking for gold. - The leader, Captain John Smith, taught the men to build houses -of stakes and branches. They plastered the walls of the houses with -mud. -#copyin -#user -#uncopyin -#match of -#log -#next -4.1g 10 diff --git a/usr.bin/learn/lib/morefiles/L4.1g b/usr.bin/learn/lib/morefiles/L4.1g deleted file mode 100644 index 7dd4f4ffefc..00000000000 --- a/usr.bin/learn/lib/morefiles/L4.1g +++ /dev/null @@ -1,49 +0,0 @@ -#print -By default, "tail" prints the last 10 lines of its input. -You can change this default amount by specifying a different -amount as an optional argument. For example, - tail -5 file -prints the last 5 lines of "file". -Collect the last line of the file "Ref" in a new file -called "last". Type "ready" when you have finished. -(By the way, there is a limit to how big the number can be, -but it's usually at least 60 or 70 lines of normal text.) -#create Ref - About a hundred and fifty years after the pilgrims settled in - Columbus discovered America in 1492. Later, other explorers - He found wild country. There were no settlers, no roads. Indians - His name was Daniel Boone. - Many settlers, besides the Pilgrims, had come to the shores of - Now Abraham Lincoln was master of the White House. But he was - The leader, Captain John Smith, taught the men to build houses -America. But they had stayed on the safe land between the sea and -But here was rich, free land -- miles and miles of it. -House was crowded with people seeking his help. -President of only part of the United States. For the Southern -States has taken down the Star-Spangled Banner and raised the flag -beginning. In 1607, three ships brought men from England to what -death during the hard winters. Others lived to build settlements -furs, and fish they found. Many Europeans decided to settle in -his shoulder and followed a buffalo trail across the mountains into -how to get the Southern States back into the Union. He needed -hunted in the woods for food. The country was beautiful and dangerous. -is now Jamestown, Virginia. They were looking for gold. -mud. -of stakes and branches. They plastered the walls of the houses with -of the Confederacy in its stead. Sad and silent, Lincoln gazed -or colonies for their mother countries. Colonial America was -quiet to think what to do. But from morning till night the White -the mountains. -this country, a young hunter picked up his gun. He tossed it onto -this wonderful land. But some of the first settlers starved to -through his spyglass at the Confederate flag that fluttered in the -visited the new land. They told people in Europe of the forests, -what is now Kentucky. -wind on the other side of the Potomac River in Virginia. He pondered -#create X1 -wind on the other side of the Potomac River in Virginia. He pondered -#user -#cmp X1 last -#log -#next -5.1a 10 diff --git a/usr.bin/learn/lib/morefiles/L4.2a b/usr.bin/learn/lib/morefiles/L4.2a deleted file mode 100644 index 7da4e621ef5..00000000000 --- a/usr.bin/learn/lib/morefiles/L4.2a +++ /dev/null @@ -1,13 +0,0 @@ -#print -Is the command - cat <file -identical to - cat file -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log -#next -4.1b 10 diff --git a/usr.bin/learn/lib/morefiles/L5.1a b/usr.bin/learn/lib/morefiles/L5.1a deleted file mode 100644 index d3d1887138a..00000000000 --- a/usr.bin/learn/lib/morefiles/L5.1a +++ /dev/null @@ -1,23 +0,0 @@ -#print -If you think back over some of the exercises you've done -so far in this course, they have involved collecting the -output of one program (like "cat" or "grep" or "ls") in -a file, then using that file as the input to another -program, like "pr" or "wc" or "grep". -For example, you could use "ls" and "wc" to _____count -the number of files in a directory. Do that now, -then type "answer N", where N is the number of files. -#create X2 -#create X1 -#create this -#create stuff -#create foo -#copyin -#user -#uncopyin -ls | %s/../lcount >X1 -tail -1 .copy >X2 -#cmp X1 X2 -#log -#next -5.1b 10 diff --git a/usr.bin/learn/lib/morefiles/L5.1b b/usr.bin/learn/lib/morefiles/L5.1b deleted file mode 100644 index 89b0411fd42..00000000000 --- a/usr.bin/learn/lib/morefiles/L5.1b +++ /dev/null @@ -1,22 +0,0 @@ -#print -It seems silly to use a temporary file when all that's really -needed is to take the output from one program like "ls", -and pass it directly to the input of another, like "wc". -One of the original contributions of Unix is a clean -way to do this, called a "pipe". You can connect two -programs with a pipe like this: - ls | wc -and the output of the first program goes into the input of -the second without any intervening file. - -Try this pair of commands in a pipeline. -Try an ordinary "ls" command too, to verify that you -got the right answer. Then type "ready". -#create X1 -#copyin -#user -#uncopyin -grep 'ls *| *wc' .copy >/dev/null -#log -#next -5.1c diff --git a/usr.bin/learn/lib/morefiles/L5.1c b/usr.bin/learn/lib/morefiles/L5.1c deleted file mode 100644 index 5df6f8e3509..00000000000 --- a/usr.bin/learn/lib/morefiles/L5.1c +++ /dev/null @@ -1,40 +0,0 @@ -#print -Another use for pipes is to replace a command sequence that we -did earlier with "cat", "pr" and a temporary file. If you have -a bunch of small files, using "pr" on them directly wastes -paper, since each file takes a page. You could say - cat memo* >temp - pr temp - rm temp -but this is a nuisance (and the output will -have the title "temp" on each page). So use -a pipe instead. -In this directory there are some files whose -names begin with "word". Use "cat", "pr" and a pipe -to print them, then type "ready". -#create word1 -now -is -the -time -for -all -#create word2 -good -men -to -come -to -the -aid -#create word3 -of -their -party. -#copyin -#user -#uncopyin -grep 'cat word.*| *pr' <.copy >/dev/null -#log -#next -5.1d 10 diff --git a/usr.bin/learn/lib/morefiles/L5.1d b/usr.bin/learn/lib/morefiles/L5.1d deleted file mode 100644 index fbc7d3be1ff..00000000000 --- a/usr.bin/learn/lib/morefiles/L5.1d +++ /dev/null @@ -1,32 +0,0 @@ -#print -How many lines of output does the command - cat word* | pr -produce, as computed by "wc"? -Type "answer N", where N is the number of lines. -(Try to use a pipe, not a temporary file.) -#create word1 -Now -is -the -time -#create word2 -for -all -good -men -#create word3 -to -come -to -the -aid -of -their -party -#copyin -#user -#uncopyin -#match 66 -#log -#next -5.1e 10 diff --git a/usr.bin/learn/lib/morefiles/L5.1e b/usr.bin/learn/lib/morefiles/L5.1e deleted file mode 100644 index 5eacc5a8b84..00000000000 --- a/usr.bin/learn/lib/morefiles/L5.1e +++ /dev/null @@ -1,19 +0,0 @@ -#print -Use "ls", "pr" and a pipe to make a neat list of the files -in this directory, sorted by time of last change. -Do not use a temporary file. -Type "ready" when you are done. -#create x1 -adfasdfasdfaf - -#create junk -qerqer -#create foo -fofofofofo -#copyin -#user -#uncopyin -grep 'ls -[l]*t.*| *pr' <.copy >/dev/null -#log -#next -6.1a 10 diff --git a/usr.bin/learn/lib/morefiles/L6.1a b/usr.bin/learn/lib/morefiles/L6.1a deleted file mode 100644 index f0a8b9e26a4..00000000000 --- a/usr.bin/learn/lib/morefiles/L6.1a +++ /dev/null @@ -1,35 +0,0 @@ -#print -Of course it is still possible to use files with "<" and ">" -to supply input to one end of a pipeline and to -collect the output from the other end. -In this directory are two files whose names begin -with "bio". Collect the last 15 lines of these two files -(combined) in a file called "last", then type "ready". -#create bio1 - Roughly speaking, your eye is made of three balls, or layers, -fitted tightly one inside the other. the tough white outermost -layer's function is to protect the others. the middle layer gives -the front of your eye its brown, gray, or blue color. The inside -of this layer is dark and full of tiny blood vessels. The innermost -layer, called the retina, is made of very special nerve cells that -are sensitive to light and color. A nerve cord connects the retina -of each eye to your brain. - The front of your eye's two outer layers (the cornea) is clear, -or open, to let light enter. -#create bio2 - We do not know when life began on the earth, and it seems likely -that the answer to this question will remain forever hidden from us. -What we do know is that it was some 500 million years ago when the -plants and animals of early geologic history had reached a stage of -development where they produced hard parts capable of being preserved -as fossils. - At this distant date there seemingly was no land life; all life -was in the sea. Moreover, there were no vertebrates, or backboned -animals, living -- at least none of sufficient complexity that they -left hard structures to be preserved in the form of fossils. -#user -cat bio* | tail -15 >X1 -#cmp X1 last -#log -#next -6.1b 10 diff --git a/usr.bin/learn/lib/morefiles/L6.1b b/usr.bin/learn/lib/morefiles/L6.1b deleted file mode 100644 index e85277caa33..00000000000 --- a/usr.bin/learn/lib/morefiles/L6.1b +++ /dev/null @@ -1,128 +0,0 @@ -#print -Several of the programs we have been using as examples, -such as "grep" and "wc", have the property that when -you use file names with them, the output includes -the file names. For example, if you say - grep pattern file1 file2 file3 -each line that contains "pattern" is printed out -with "file1:" or whatever in front of it. - -Sometimes you would love to get rid of that file name, since -you don't care a bit where the line came from, -and the file name clutters up the output. -One thing is to use "cat" to collect the files, and -pipe into "grep"; in that case "grep" doesn't mention -any file name because there isn't one. - -In this directory there are several files whose names end -in ".x". Use a pipeline of "cat" and "grep" to print all the lines -that contain the letters "ion", without any identifying filenames. -Type "ready" when you're done. -#create 0x -ion, but this one is in the wrong file! -#create 1.x -o -o' -oaf -oafish -oafishly -oafishness -oak -oaken -oaks -oakum -oar -oared -oarfish -oarlock -oarsman -oases -oasis -oat -oatcake -oaten -oath -oaths -oatmeal -obbligati -obbligato -obbligatos -obconic -obcordate -obduracy -obdurate -#create 2.x -obdurately -obdurateness -obeah -obedience -obedient -obediently -obeisance -obeisant -obeli -obelisk -obelize -obelus -obese -obesity -obey -obeyer -obfuscate -obfuscation -obfuscatory -obi -obit -obituary -object -objectification -objectify -objection -objectionable -objectionableness -objectionably -objective -#create 3.x -objectively -objectiveness -objectivism -objectivist -objectivistic -objectivity -objectless -objector -objurgate -objurgation -objurgatory -oblanceolate -oblast -oblate -oblate -oblateness -oblation -obligate -obligately -obligation -obligatorily -obligatory -oblige -obligee -obliger -obliging -obligingly -obligingness -obligor -oblique -obliquely -obliqueness -obliquity -obliterate -#copyout -#user -#uncopyout -grep ion <.ocopy >X1 -cat *.x | grep ion >X2 -#cmp X1 X2 -#log -#next -6.1c diff --git a/usr.bin/learn/lib/morefiles/L6.1c b/usr.bin/learn/lib/morefiles/L6.1c deleted file mode 100644 index 55949867d43..00000000000 --- a/usr.bin/learn/lib/morefiles/L6.1c +++ /dev/null @@ -1,23 +0,0 @@ -#print -In much the same way that you used "cat" and a pipe to -get rid of the file names from the output of "grep", -you can use "cat" and a pipe to get rid of the sub-totals -from "wc", if you so desire. -What is the total number of lines in the files in -this directory whose names begin with capital letters? -Type "answer N", where N is the number of lines. -#create X1 -just to make sure. -#create Stuff -this has some more. -#create Junk -asdfadfasdfasdfasdfasf -#copyin -#user -#uncopyin -cat [A-Z]* | %s/../lcount >x1 -tail -1 .copy >x2 -#cmp x1 x2 -#log -#next -6.1d diff --git a/usr.bin/learn/lib/morefiles/L6.1d b/usr.bin/learn/lib/morefiles/L6.1d deleted file mode 100644 index 47446b54446..00000000000 --- a/usr.bin/learn/lib/morefiles/L6.1d +++ /dev/null @@ -1,56 +0,0 @@ -#print -How many of the lines in the files "bio*" and "chem*" -contain the letters "the"? Type "answer N", where -N is the number of lines. -#create bio1 - Roughly speaking, your eye is made of three balls, or layers, -fitted tightly one inside the other. the tough white outermost -layer's function is to protect the others. the middle layer gives -the front of your eye its brown, gray, or blue color. The inside -of this layer is dark and full of tiny blood vessels. The innermost -layer, called the retina, is made of very special nerve cells that -are sensitive to light and color. A nerve cord connects the retina -of each eye to your brain. - The front of your eye's two outer layers (the cornea) is clear, -or open, to let light enter. -#create bio2 - We do not know when life began on the earth, and it seems likely -that the answer to this question will remain forever hidden from us. -What we do know is that it was some 500 million years ago when the -plants and animals of early geologic history had reached a stage of -development where they produced hard parts capable of being preserved -as fossils. - At this distant date there seemingly was no land life; all life -was in the sea. Moreover, there were no vertebrates, or backboned -animals, living -- at least none of sufficient complexity that they -left hard structures to be preserved in the form of fossils. -#create chema - The baker said, "Now I shall put just the right amounts of water and -yeast with the flour that is in the mixer. Flour, water, and yeast -together make the sponge. Making sponge is the first step in making -bread." - The baker closed the mixer. Inside the machine, the flour and -yeast and water went around and around until they were well mixed. -Then the baker opened the mixer and the sponge dropped into a greased -tub called a trough. - The baker pushed the trough into a warm room to let the sponge -rise. It looked like dough, but it did not as yet have everything -in it. -#create chemb - Wash the blackboard. Watch it dry. The water goes into the air. -When water goes into the air it evaporates. - Tie a damp cloth to one end of a stick. Tie a bottle to the -other end. Put water in the bottle until the stick is level. Watch -the stick for a few minutes. It does not stay level. - Water goes into the air when it evaporates. It changes into -water vapor. You cannot see water vapor, but it is in the air all -around you. - Cut a hold in the bottom of a cardboard box. Hold the box -against a cold window and blow into the hole. -#copyin -#user -#uncopyin -#match 30 -#log -#next -6.1e diff --git a/usr.bin/learn/lib/morefiles/L6.1e b/usr.bin/learn/lib/morefiles/L6.1e deleted file mode 100644 index c75d50ee3e5..00000000000 --- a/usr.bin/learn/lib/morefiles/L6.1e +++ /dev/null @@ -1,38 +0,0 @@ -#print -By the way, you can also use "grep" to print out ___all ___but -those lines that contain occurrences of a pattern: - grep -v pat files... -prints all the lines in files... that don't contain -any "pat". -How many of the lines in "bio*" don't contain "the"? -Type "answer N", where N is the number of lines. -#create bio1 - Roughly speaking, your eye is made of three balls, or layers, -fitted tightly one inside the other. the tough white outermost -layer's function is to protect the others. the middle layer gives -the front of your eye its brown, gray, or blue color. The inside -of this layer is dark and full of tiny blood vessels. The innermost -layer, called the retina, is made of very special nerve cells that -are sensitive to light and color. A nerve cord connects the retina -of each eye to your brain. - The front of your eye's two outer layers (the cornea) is clear, -or open, to let light enter. -#create bio2 - We do not know when life began on the earth, and it seems likely -that the answer to this question will remain forever hidden from us. -What we do know is that it was some 500 million years ago when the -plants and animals of early geologic history had reached a stage of -development where they produced hard parts capable of being preserved -as fossils. - At this distant date there seemingly was no land life; all life -was in the sea. Moreover, there were no vertebrates, or backboned -animals, living -- at least none of sufficient complexity that they -left hard structures to be preserved in the form of fossils. -#copyin -#user -#uncopyin -#match 6 -#log -#next -7.1a 10 -6.2e 5 diff --git a/usr.bin/learn/lib/morefiles/L6.2e b/usr.bin/learn/lib/morefiles/L6.2e deleted file mode 100644 index 190a33c9f72..00000000000 --- a/usr.bin/learn/lib/morefiles/L6.2e +++ /dev/null @@ -1,106 +0,0 @@ -#print -How many words in the file "o" do not contain a -slash "/"? Type "answer N", where N is the number of words. -#create o -o -o' -oaf -oaf/ish -oaf/ish/ly -oaf/ish/ness -oak -oak/en -oaks -oa/kum -oar -oared -oar/fish -oar/lock -oars/man -oa/ses -oa/sis -oat -oat/cake -oat/en -oath -oaths -oat/meal -ob/bli/ga/ti -ob/bli/ga/to -obbligatos -ob/con/ic -ob/cor/date -ob/du/ra/cy -ob/du/rate -ob/du/rate/ly -ob/du/rate/ness -obe/ah -obe/di/ence -obe/di/ent -obe/di/ent/ly -obei/sance -obei/sant -ob/e/li -ob/e/lisk -ob/e/lize -ob/e/lus -obese -obe/si/ty -obey -obey/er -ob/fus/cate -ob/fus/ca/tion -ob/fus/ca/to/ry -obi -obit -obit/u/ary -ob/ject -ob/jec/ti/fi/ca/tion -ob/jec/ti/fy -ob/jec/tion -ob/jec/tion/able -ob/jec/tion/able/ness -ob/jec/tion/ably -ob/jec/tive -ob/jec/tive/ly -ob/jec/tive/ness -ob/jec/tiv/ism -ob/jec/tiv/ist -ob/jec/tiv/is/tic -ob/jec/tiv/i/ty -ob/ject/less -ob/jec/tor -ob/jur/gate -ob/jur/ga/tion -ob/jur/ga/to/ry -ob/lan/ceo/late -oblast -ob/late -oblate -oblate/ness -obla/tion -ob/li/gate -ob/li/gate/ly -ob/li/ga/tion -oblig/a/to/ri/ly -oblig/a/to/ry -oblige -ob/li/gee -oblig/er -oblig/ing -oblig/ing/ly -oblig/ing/ness -ob/li/gor -oblique -oblique/ly -oblique/ness -obliq/ui/ty -oblit/er/ate -oblit/er/a/tion -#copyin -#user -#uncopyin -#match 19 -#log -#next -7.1a diff --git a/usr.bin/learn/lib/morefiles/L7.1a b/usr.bin/learn/lib/morefiles/L7.1a deleted file mode 100644 index 08e7087344d..00000000000 --- a/usr.bin/learn/lib/morefiles/L7.1a +++ /dev/null @@ -1,9 +0,0 @@ -#print -Do you think that you have learned anything -from this script? -Answer yes or no. -#copyin -#user -#uncopyin -#match yes -#log diff --git a/usr.bin/learn/src/Makefile b/usr.bin/learn/src/Makefile deleted file mode 100644 index 6c186e7be1d..00000000000 --- a/usr.bin/learn/src/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# $OpenBSD: Makefile,v 1.3 2001/01/29 01:57:59 niklas Exp $ - -PROG = learn - -LLIB = /usr/share/learn # must agree with pathnames.h - -CFLAGS += -g - -all: learn tee lcount - -# tee and lcount must be installed in LLIB! -# old makefile installed learn into LLIB as well - is it needed there? -install: all - echo install -o ${BINOWN} -g ${BINGRP} -m 444 learn \ - ${DESTDIR}${BINDIR}/learn; \ - install -o ${BINOWN} -g ${BINGRP} tee lcount $(LLIB) - -check: - -@test -r $(LLIB)/tee || echo 'tee not present; make tee' - -@test -r $(LLIB)/lcount || echo 'lcount not present; make lcount' - - -# clean rule should also remove tee and lcount - -.include <bsd.prog.mk> diff --git a/usr.bin/learn/src/README b/usr.bin/learn/src/README deleted file mode 100644 index 8e677df975b..00000000000 --- a/usr.bin/learn/src/README +++ /dev/null @@ -1,15 +0,0 @@ -Learn was originally written by Mike Lesk with some contributions -from Brian Kernighan. The paper in the /usr/share/doc/usd/02.learn -directory dates from the second version of learn, around 1979. - -This version of learn has been resurrected from the original V7 -source and edited enough that the source compiles and the -lessons can be executed. We have made no attempt to update the -lessons, nor to fix some of the glaring problems with the code. -Think of it as a historical document, not a polished system. -A historical document, that is, describing code that once -worked fine. It sort of limps along now, but there are -some things that don't work right. Caveat emptor. - -Code warmed over at OpenBSD, September, 1998. -$OpenBSD: README,v 1.2 1998/09/28 16:40:16 ian Exp $ diff --git a/usr.bin/learn/src/lcount.c b/usr.bin/learn/src/lcount.c deleted file mode 100644 index 90c3fc1d2d9..00000000000 --- a/usr.bin/learn/src/lcount.c +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: lcount.c,v 1.4 2001/11/19 19:02:14 mpech Exp $ */ - -/* count lines in something */ - -/**************************************************************** -Copyright (C) AT&T 1995 -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of AT&T or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -AT&T DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL AT&T OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. -****************************************************************/ - -#include "stdio.h" - -int -main() -{ - int n, c; - - n = 0; - while ((c = getchar()) != EOF) - if (c == '\n') - n++; - printf("%d\n", n); - return 0; -} diff --git a/usr.bin/learn/src/learn.1 b/usr.bin/learn/src/learn.1 deleted file mode 100644 index 20dc9a0cf1d..00000000000 --- a/usr.bin/learn/src/learn.1 +++ /dev/null @@ -1,68 +0,0 @@ -.\" $OpenBSD: learn.1,v 1.7 2007/05/31 19:20:12 jmc Exp $ -.\" -.\" Copyright (c) 1998 Ian Darwin -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt LEARN 1 -.Os -.Sh NAME -.Nm learn -.Nd computer based learning -.Sh SYNOPSIS -.Nm learn -.Op lesson -.Sh DESCRIPTION -This is a resurrection of the learn command from V7 UNIX, circa 1979. -The program works fine, but many of the lessons are quite antiquated. -It remains for others to write new lessons describing current -versions of UNIX-like systems. -.Sh FILES -.Bl -tag -width "/usr/libdata/learn/*" -compact -.It Pa /usr/libdata/learn/* -lesson files -.It Pa /tmp/pl* -playground directory created for each invocation, removed at end of run -.El -.Sh SEE ALSO -Learn \- Computer-Aided Instruction on UNIX, -(Second Edition), Brian W. Kernighan and Michael E. Lesk. -January 30, 1979 -.Pp -The version described there created the "play" directory for each -user under the lesson file directory; this version creates -a directory under -.Pa /tmp -for each user. -.Sh HISTORY -The program originated in Seventh Edition UNIX. -A lightly revised version of the program was released by -Lucent/Bell Laboratories in 1997, and -modernized for -.Ox 2.4 -by Ian Darwin, who also wrote this man page, and Paul Janzen. -.Sh BUGS -The lessons need updating. There should be lessons on awk, sed, -perl, shell, and other scripting languages. -.Pp -There is no way to drive a screen-based program such as vi or emacs. -.Pp -Could do a better job of displaying the text. Maybe curses? -Or maybe the text should be re-written in HTML? -.Pp -Perhaps the lesson file should be reorganized so that all the lessons -for each topic are in one large file instead of so many tiny ones. diff --git a/usr.bin/learn/src/learn.c b/usr.bin/learn/src/learn.c deleted file mode 100644 index 2ffe8b5c9e5..00000000000 --- a/usr.bin/learn/src/learn.c +++ /dev/null @@ -1,1048 +0,0 @@ -/* - * learn, from V7 UNIX: one of the earliest Computer Based Training (CBT) - * programs still in existence. - * - * $OpenBSD: learn.c,v 1.11 2007/10/05 14:19:05 chl Exp $ - */ - -/**************************************************************** -Copyright (C) AT&T 1995 -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of AT&T or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -AT&T DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL AT&T OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. -****************************************************************/ - -#include <fcntl.h> -#include <stdio.h> -#include <signal.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> - -#include "learn.h" -#include "pathnames.h" - -char *direct = _PATH_LLIB; -int more; -char *level; -int speed; -char *sname; -char *todo; -FILE *incopy = NULL; -int didok; -int sequence = 1; -int comfile = -1; -int status; -int wrong; -char *pwline; -char *playdir; -FILE *scrin; -int logging = 0; /* set to 0 to turn off logging */ -int ask; - -int -main(int argc, char **argv) -{ - extern char * getlogin(); - void hangup(int signum); - void intrpt(int signum); - - speed = 0; - more = 1; - pwline = getlogin(); - setbuf(stdout, malloc(BUFSIZ)); - selsub(argc, argv); - signal(SIGHUP, hangup); - signal(SIGINT, intrpt); - while (more) { - selunit(); - dounit(); - whatnow(); - } - wrapup(0); - return 0; -} - -void hangup(int x) -{ - wrapup(1); -} - -void intrpt(int x) -{ - char response[20], *p; - - signal(SIGINT, hangup); - write(2, "\nInterrupt.\nWant to go on? ", 28); - p = response; - *p = 'n'; - while (read(0, p, 1) == 1 && *p != '\n') - p++; - if (response[0] != 'y') - wrapup(1); - ungetc('\n', stdin); - signal(SIGINT, intrpt); -} - - -char last[1024]; -char logf[1024]; -char subdir[1024]; - -copy(prompt, fin) -FILE *fin; -{ - FILE *fout, *f; - char s[200], t[200], s1[200], *r, *tod; - char nm[100]; - int *p, tv[2]; - extern int *action(); - extern char *wordb(); - int nmatch = 0; - - if (subdir[0]==0) - snprintf(subdir, sizeof subdir, "%s/%s", _PATH_LLIB, sname); - for (;;) { - if (pgets(s, sizeof s, prompt, fin) == 0) - if (fin == stdin) { - /* fprintf(stderr, "Don't type control-D\n"); */ - /* this didn't work out very well */ - wrapup(1); /* ian */ - continue; - } else - break; - trim(s); - /* change the sequence %s to lesson directory */ - /* if needed */ - for (r = s; *r; r++) - if (*r == '%') { - snprintf(s1, sizeof s1, s, subdir, subdir, subdir); - strlcpy(s, s1, sizeof s); - break; - } - r = wordb(s, t); - p = action(t); - if (p && *p == ONCE) { /* some actions done only once per script */ - if (wrong) { /* we are on 2nd time */ - scopy(fin, NULL); - continue; - } - strlcpy(s, r, sizeof s); - r = wordb(s, t); - p = action(t); - } - if (p == 0) { - if (comfile >= 0) { - write(comfile, s, strlen(s)); - write(comfile, "\n", 1); - } - else { - signal(SIGINT, SIG_IGN); - status = mysys(s); - signal(SIGINT, intrpt); - } - if (incopy) { - fprintf(incopy, "%s\n", s); - strlcpy(last, s, sizeof last); - } - continue; - } - switch (*p) { - case READY: - if (incopy && r) { - fprintf(incopy, "%s\n", r); - strlcpy(last, r, sizeof last); - } - return; - case PRINT: - if (wrong) - scopy(fin, NULL); /* don't repeat message */ - else if (r) - list(r); - else - scopy(fin, stdout); - break; - case NOP: - break; - case MATCH: - if (nmatch > 0) /* we have already passed */ - scopy(fin, NULL); - else if ((status = strcmp(r, last)) == 0) { /* did we pass this time? */ - nmatch++; - scopy(fin, stdout); - } else - scopy(fin, NULL); - break; - case BAD: - if (strcmp(r, last) == 0) { - scopy(fin, stdout); - } else - scopy(fin, NULL); - break; - case SUCCEED: - scopy(fin, (status == 0) ? stdout : NULL); - break; - case FAIL: - scopy(fin, (status != 0) ? stdout : NULL); - break; - case CREATE: - fout = fopen(r, "w"); - scopy(fin, fout); - fclose(fout); - break; - case CMP: - status = cmp(r); /* contains two file names */ - break; - case MV: - snprintf(nm, sizeof nm, "%s/L%s.%s", subdir, todo, r); - fcopy(r, nm); - break; - case USER: - case NEXT: - more = 1; - return; - case COPYIN: - incopy = fopen(".copy", "w"); - break; - case UNCOPIN: - fclose(incopy); - incopy = NULL; - break; - case COPYOUT: - maktee(); - break; - case UNCOPOUT: - untee(); - break; - case PIPE: - comfile = makpipe(); - break; - case UNPIPE: - close(comfile); - wait(0); - comfile = -1; - break; - case YES: - case NO: - if (incopy) { - fprintf(incopy, "%s\n", s); - strlcpy(last, s, sizeof last); - } - return; - case WHERE: - printf("You are in lesson %s\n", todo); - fflush(stdout); - break; - case BYE: - more=0; - return; - case CHDIR: - printf("cd not allowed\n"); - fflush(stdout); - break; - case LEARN: - printf("You are already in learn.\n"); - fflush(stdout); - break; - case LOG: - if (!logging) - break; - if (logf[0] == 0) - snprintf(logf, sizeof logf, "%s/log/%s", direct, sname); - f = fopen( (r? r : logf), "a"); - if (f == NULL) - break; - time(tv); - tod = ctime(tv); - tod[24] = 0; - fprintf(f, "%s L%-6s %s %2d %s\n", tod, - todo, status? "fail" : "pass", speed, pwline); - fclose(f); - break; - } - } - return; -} - -pgets(char *s, int len, int prompt, FILE *f) -{ - if (prompt) { - if (comfile < 0) - printf("$ "); - fflush(stdout); - } - if (fgets(s, len, f) != NULL) - return(1); - else - return(0); -} - -/** Trim trailing newline */ -void -trim(char *s) -{ - s[strcspn(s, "\n")] = '\0'; -} - -scopy(fi, fo) /* copy fi to fo until a line with # */ -FILE *fi, *fo; -{ - int c; - - while ((c = getc(fi)) != '#' && c != EOF) { - do { - if (fo != NULL) - putc(c, fo); - if (c == '\n') - break; - } while ((c = getc(fi)) != EOF); - } - if (c == '#') - ungetc(c, fi); - if (fo != NULL) - fflush(fo); -} - -cmp(r) /* compare two files for status */ -char *r; -{ - char *s; - FILE *f1, *f2; - int c1, c2, stat; - - for (s = r; *s != ' ' && *s != '\0'; s++) - ; - *s++ = 0; /* r contains file 1 */ - while (*s == ' ') - s++; - f1 = fopen(r, "r"); - f2 = fopen(s, "r"); - if (f1 == NULL || f2 == NULL) - return(1); /* failure */ - stat = 0; - for (;;) { - c1 = getc(f1); - c2 = getc(f2); - if (c1 != c2) { - stat = 1; - break; - } - if (c1 == EOF || c2 == EOF) - break; - } - fclose(f1); - fclose(f2); - return(stat); -} - -char * -wordb(s, t) /* in s, t is prefix; return tail */ -char *s, *t; -{ - int c; - - while (c = *s++) { - if (c == ' ' || c == '\t') - break; - *t++ = c; - } - *t = 0; - while (*s == ' ' || *s == '\t') - s++; - return(c ? s : NULL); -} - - -dounit() -{ - char tbuff[100]; - - if (todo == 0) - return; - wrong = 0; -retry: - start(todo); - /* script = lesson */ - snprintf(tbuff, sizeof tbuff, "%s/%s/L%s", _PATH_LLIB, sname, todo); - scrin = fopen(tbuff, "r"); - if (scrin == NULL) { - fprintf(stderr, "No script.\n"); - err(1, "%s", tbuff); - wrapup(1); - } - - copy(0, scrin); - if (more == 0) - return; - copy(1, stdin); - if (more == 0) - return; - copy(0, scrin); - - if (comfile >= 0) - close(comfile); - wait(&didok); - didok = (status == 0); - if (!didok) { - wrong++; - printf("\nSorry, that's %snot right. Do you want to try again? ", - wrong > 1 ? "still " : ""); - fflush(stdout); - for(;;) { - if (fgets(tbuff, sizeof tbuff, stdin) == NULL) - errx(1, "could not read input"); - trim(tbuff); - if (tbuff[0] == 'y') { - printf("Try the problem again.\n"); - fflush(stdout); - goto retry; - } else if (strcmp(tbuff, "bye") == 0) { - wrapup(1); - } else if (tbuff[0] == 'n') { - wrong = 0; - printf("\nOK. Lesson %s (%d)\n", todo, speed); - printf("Skipping to next lesson.\n\n"); - fflush(stdout); - break; - } else { - printf("Please type yes, no or bye: "); - fflush(stdout); - } - } - } - setdid(todo, sequence++); -} - -int istop; - -list(r) -char *r; -{ - void stop(int); - FILE *ft; - char s[200]; - - if (r==0) - return; - istop = 1; - signal(SIGINT, stop); - ft = fopen(r, "r"); - if (ft != NULL) { - while (fgets(s, sizeof s, ft) && istop) - fputs(s, stdout); - fclose(ft); - } - signal(SIGINT, intrpt); -} - -void stop(int x) -{ - istop=0; -} - -makpipe() -{ - int f[2]; - - pipe(f); - if (fork()==0) { - close(f[1]); - close(0); - dup(f[0]); - close(f[0]); - execl ("/bin/sh", "sh", "-i", (char *)NULL); - execl ("/usr/bin/sh", "sh", "-i", (char *)NULL); - write(2,"Exec error\n",11); - } - close(f[0]); - sleep(2); /* so shell won't eat up too much input */ - return(f[1]); -} - -static int oldout; -static char tee[100]; - -maktee() -{ - int fpip[2], in, out; - - if (tee[0] == 0) - snprintf(tee, sizeof tee, "%s/tee", direct); - pipe(fpip); - in = fpip[0]; - out= fpip[1]; - if (fork() == 0) { - signal(SIGINT, SIG_IGN); - close(0); - close(out); - dup(in); - close(in); - execl (tee, "lrntee", (char *)NULL); - fprintf(stderr, "Tee exec failed\n"); - exit(1); - } - close(in); - fflush(stdout); - oldout = dup(1); - close(1); - if (dup(out) != 1) - fprintf(stderr, "Error making tee for copyout\n"); - close(out); - return(1); -} - -untee() -{ - int x; - - fflush(stdout); - close(1); - dup(oldout); - close(oldout); - wait(&x); -} - -# define SAME 0 - -struct keys { - char *k_wd; - int k_val; -} keybuff[] = { - {"ready", READY}, - {"answer", READY}, - {"#print", PRINT}, - {"#copyin", COPYIN}, - {"#uncopyin", UNCOPIN}, - {"#copyout", COPYOUT}, - {"#uncopyout", UNCOPOUT}, - {"#pipe", PIPE}, - {"#unpipe", UNPIPE}, - {"#succeed", SUCCEED}, - {"#fail", FAIL}, - {"bye", BYE}, - {"chdir", CHDIR}, - {"cd", CHDIR}, - {"learn", LEARN}, - {"#log", LOG}, - {"yes", YES}, - {"no", NO}, - {"#mv", MV}, - {"#user", USER}, - {"#next", NEXT}, - {"skip", SKIP}, - {"#where", WHERE}, - {"#match", MATCH}, - {"#bad", BAD}, - {"#create", CREATE}, - {"#cmp", CMP}, - {"#goto", GOTO}, - {"#once", ONCE}, - {"#", NOP}, - {NULL, 0} -}; - -int *action(s) -char *s; -{ - struct keys *kp; - for (kp=keybuff; kp->k_wd; kp++) - if (strcmp(kp->k_wd, s) == SAME) - return(&(kp->k_val)); - return(NULL); -} - -# define NW 100 -# define NWCH 800 -struct whichdid { - char *w_less; - int w_seq; -} which[NW]; -int nwh = 0; -char whbuff[NWCH]; -char *whcp = whbuff; - -setdid(lesson, sequence) -char *lesson; -{ - struct whichdid *pw; - for(pw=which; pw < which+nwh; pw++) - if (strcmp(pw->w_less, lesson) == SAME) - { - pw->w_seq = sequence; - return; - } - pw=which+nwh++; - if (nwh >= NW) { - fprintf(stderr, "nwh>=NW\n"); - wrapup(1); - } - pw->w_seq = sequence; - pw->w_less = whcp; - while (*whcp++ = *lesson++); - if (whcp >= whbuff + NWCH) { - fprintf(stderr, "lesson name too long\n"); - wrapup(1); - } -} - -already(lesson, sequence) -char *lesson; -{ - struct whichdid *pw; - for (pw=which; pw < which+nwh; pw++) - if (strcmp(pw->w_less, lesson) == SAME) - return(1); - return(0); -} - - -#define EASY 1 -#define MEDIUM 2 -#define HARD 3 - -mysys(s) -char *s; -{ - /* like "system" but rips off "mv", etc.*/ - /* also tries to guess if can get away with exec cmd */ - /* instead of sh cmd */ - char p[300]; - char *np[40]; - char *t; - int nv, type, stat; - - type = EASY; /* we hope */ - for (t = s; *t && type != HARD; t++) { - switch (*t) { - case '*': - case '[': - case '?': - case '>': - case '<': - case '$': - case '\'': - case '"': - type = MEDIUM; - break; - case '|': - case ';': - case '&': - type = HARD; - break; - } - } - switch (type) { - case HARD: - return(system(s)); - case MEDIUM: - strlcpy(p, "exec ", sizeof p); - strlcat(p, s, sizeof p); - return(system(p)); - case EASY: - strlcpy(p, s, sizeof p); - nv = getargs(p, np); - t=np[0]; - if ((strcmp(t, "mv") == 0)|| - (strcmp(t, "cp") == 0)|| - (strcmp(t, "rm") == 0)|| - (strcmp(t, "ls") == 0) ) { - if (fork() == 0) { - char b[100]; - signal(SIGINT, SIG_DFL); - strlcpy(b, "/bin/", sizeof b); - strlcat(b, t, sizeof b); - np[nv] = 0; - execv(b, np); - fprintf(stderr, "Execv failed\n"); - exit(1); - } - wait(&stat); - return(stat); - } - return(system(s)); - } -} - -/* - * system(): - * same as library version, except that resets - * default handling of signals in child, so that - * user gets the behavior he expects. - */ - -int system(const char *s) -{ - int status; - pid_t pid, w; - void (*istat)(int), (*qstat)(int); - - istat = signal(SIGINT, SIG_IGN); /* XXX should use sigaction() */ - qstat = signal(SIGQUIT, SIG_IGN); - if ((pid = fork()) == 0) { - signal(SIGINT, SIG_DFL); - signal(SIGQUIT, SIG_DFL); - execl("/bin/sh", "sh", "-c", s, (char *)NULL); - _exit(127); - } - while ((w = wait(&status)) != pid && w != -1) - ; - if (w == -1) - status = -1; - signal(SIGINT, istat); - signal(SIGQUIT, qstat); - return(status); -} - -getargs(s, v) -char *s, **v; -{ - int i; - - i = 0; - for (;;) { - v[i++]=s; - while (*s != 0 && *s!=' '&& *s != '\t') - s++; - if (*s == 0) - break; - *s++ =0; - while (*s == ' ' || *s == '\t') - s++; - if (*s == 0) - break; - } - return(i); -} - - -selsub(argc,argv) -char *argv[]; -{ - char ans1[100], *cp; - static char ans2[30]; - static char dirname[20]; - static char subname[20]; - - if (argc > 1 && argv[1][0] == '-') { - direct = argv[1]+1; - argc--; - argv++; - } - chknam(direct); - if (chdir(direct) != 0) { - fprintf(stderr, "can't cd to %s\n", direct); - exit(1); - } - sname = argc > 1 ? argv[1] : 0; - if (argc > 2) - strlcpy(level=ans2, argv[2], sizeof ans2); - else - level = 0; - if (argc > 3 ) - speed = atoi(argv[3]); - if (!sname) { - printf("These are the available courses -\n"); - list("Linfo"); - printf("If you want more information about the courses,\n"); - printf("or if you have never used 'learn' before,\n"); - printf("type 'return'; otherwise type the name of\n"); - printf("the course you want, followed by 'return'.\n"); - fflush(stdout); - if (fgets(sname=subname, sizeof subname, stdin) == NULL) - errx(1, "could not read input"); - trim(sname); - if (sname[0] == '\0') { - list("Xinfo"); - do { - printf("\nWhich subject? "); - fflush(stdout); - if (fgets(sname=subname, sizeof subname, stdin) == NULL) - errx(1, "could not read input"); - trim(sname); - } while (sname[0] == '\0'); - } - } - chknam(sname); - if (!level) { - printf("If you were in the middle of this subject\n"); - printf("and want to start where you left off, type\n"); - printf("the last lesson number the computer printed.\n"); - printf("To start at the beginning, just hit return.\n"); - fflush(stdout); - if (fgets(ans2, sizeof ans2, stdin) == NULL) - errx(1, "could not read input"); - trim(ans2); - if (ans2[0]==0) - strlcpy(ans2,"0", sizeof ans2); - for (cp=ans2; *cp; cp++) - if (*cp == '(' || *cp == ' ') - *cp= 0; - level=ans2; - } - - /* make new directory for user to play in */ - if ((playdir=mkdtemp(strdup("/tmp/plXXXXXX"))) == NULL || - chdir(playdir) < 0) { - fprintf(stderr, "Couldn't create playpen directory %s.\n", playdir); - fprintf(stderr, "Bye.\n"); - exit(1); - } - - /* after this point, we have a working directory. */ - /* have to call wrapup to clean up */ - snprintf(ans1, sizeof ans1, "%s/%s/Init", direct, sname); - if (access(ans1, R_OK)==0) { - snprintf(ans1, sizeof ans1, "%s/%s/Init %s", direct,sname, level); - if (system(ans1) != 0) { - printf("Leaving learn.\n"); - wrapup(1); - } - } - if (level[0] == '-') /* no lesson names start with - */ - ask = 1; - start(level); -} - -chknam(name) -char *name; -{ - if (access(name, R_OK|X_OK) < 0) { - printf("Sorry, there is no subject or lesson named %s.\nBye.\n", name); - exit(1); - } -} - - -int nsave = 0; - -selunit() -{ - char fnam[1024], s[1024]; - static char dobuff[50]; - char posslev[20][20]; - int diff[20], i, k, m, n, best, alts; - FILE *f; - char zb[200]; - static char saved[20]; - - while (ask) { - printf("What lesson? "); - fflush(stdout); - if (fgets(dobuff, sizeof dobuff, stdin) == NULL) - errx(1, "could not read input"); - trim(dobuff); - if (strcmp(dobuff, "bye") == 0) - wrapup(0); - level = todo = dobuff; - snprintf(s, sizeof s, "%s/%s/L%s", _PATH_LLIB, sname, dobuff); - if (access(s, R_OK) == 0) - return; - printf("no such lesson\n"); - } - alts = 0; -retry: - f=scrin; - if (f==NULL) { - snprintf(fnam, sizeof fnam, "%s/%s/L%s", _PATH_LLIB, sname, level); - f = fopen(fnam, "r"); - if (f==NULL) { - fprintf(stderr, "No script for lesson %s.\n", level); - err(1, "%s", fnam); - wrapup(1); - } - while (fgets(zb, sizeof zb, f)) { - trim(zb); - if (strcmp(zb, "#next")==0) - break; - } - } - if (feof(f)) { - printf("Congratulations; you have finished this sequence.\n"); - fflush(stdout); - todo = 0; - return; - } - for(i=0; fgets(s, 50, f); i++) { - sscanf(s, "%s %d", posslev[i], &diff[i]); - } - best = -1; - /* cycle through lessons from random start */ - /* first try the current place, failing that back up to - last place there are untried alternatives (but only one backup) */ - n = grand()%i; - for(k=0; k<i; k++) { - m = (n+k)%i; - if (already(posslev[m],0)) continue; - if (best<0) best=m; - /* real alternatives */ - alts++; - if (abs(diff[m]-speed) < abs(diff[best]-speed)) - best=m; - } - if (best < 0 && nsave) { - nsave--; - strcpy(level, saved); - goto retry; - } - if (best <0) { - /* lessons exhausted or missing */ - printf("Sorry, there are no alternative lessons at this stage.\n"); - printf("See someone for help.\n"); - fflush(stdout); - todo = 0; - return; - } - strlcpy(dobuff, posslev[best], sizeof dobuff); - if (alts>1) { - nsave=1; - strlcpy (saved, level, sizeof saved); - } - todo = dobuff; - fclose(f); -} - -abs(x) -{ - return(x>=0? x: -x); -} - -grand() -{ - static int garbage; - int a[2], b; - - time(a); - b = a[1]+10*garbage++; - return(b&077777); -} - -#define ND 64 - -start(char *lesson) -{ - struct direct { - int inode; - char name[14]; - }; -#if 0 - struct direct dv[ND], *dm, *dp; - int f, c, n; -#endif - char where [1024]; - -#if 0 - /* I'm not sure the point of this loop to unlink files, it may be - * some kind of cleanup. I'm sure I don't like unlinking files - * like this and, anyway, it would all have to be recoded using - * opendir() and readdir(). -- Ian - */ - f = open(".", O_RDONLY); - n = read(f, dv, ND*sizeof(*dp)); - n /= sizeof(*dp); - if (n==ND) - fprintf(stderr, "lesson too long\n"); - dm = dv+n; - for(dp=dv; dp<dm; dp++) - if (dp->inode) { - n = strlen(dp->name); - if (dp->name[n-2] == '.' && dp->name[n-1] == 'c') - continue; - c = dp->name[0]; - if (c>='a' && c<= 'z') - unlink(dp->name); - } - close(f); - if (ask) - return; -#endif - snprintf(where, sizeof where, "%s/%s/L%s", _PATH_LLIB, sname, lesson); - if (access(where, R_OK)==0) /* there is a file */ - return; - fprintf(stderr, "No lesson %s\n",lesson); - err(1, "%s", where); - wrapup(1); -} - -fcopy(new,old) -char *new, *old; -{ - char b[512]; - int n, fn, fo; - fn = creat(new, 0666); - fo = open(old, O_RDONLY); - if (fo<0) return; - if (fn<0) return; - while ( (n=read(fo, b, 512)) > 0) - write(fn, b, n); - close(fn); - close(fo); -} - - -whatnow() -{ - if (todo == 0) { - more=0; - return; - } - if (didok) { - strcpy(level,todo); - if (speed<=9) speed++; - } - else { - speed -= 4; - /* the 4 above means that 4 right, one wrong leave - you with the same speed. */ - if (speed <0) speed=0; - } - if (wrong) { - speed -= 2; - if (speed <0 ) speed = 0; - } - if (didok && more) { - printf("\nGood. Lesson %s (%d)\n\n",level, speed); - fflush(stdout); - } -} - - -wrapup(n) -int n; -{ - /* this routine does not use 'system' because it wants - interrupts turned off */ - int retval; - pid_t pid; - - signal(SIGINT, SIG_IGN); - chdir(".."); - if ( (pid=fork()) ==0) { - signal(SIGHUP, SIG_IGN); - execl("/bin/rm", "rm", "-r", playdir, (char *)NULL); - execl("/usr/bin/rm", "rm", "-r", playdir, (char *)NULL); - fprintf(stderr, "Can't find 'rm' command.\n"); - exit(0); - } - printf("Bye.\n"); /* not only does this reassure user but - it stalls for time while deleting directory */ - fflush(stdout); - /* printf("Wanted %ld got %ld val %d\n", (long)pid, (long)pidw, retval); */ - exit(n); -} diff --git a/usr.bin/learn/src/learn.h b/usr.bin/learn/src/learn.h deleted file mode 100644 index ca88f9e3ca7..00000000000 --- a/usr.bin/learn/src/learn.h +++ /dev/null @@ -1,54 +0,0 @@ -/* defines for learn. - * $OpenBSD: learn.h,v 1.2 1998/09/28 16:40:17 ian Exp $ - */ - -#define READY 0 -#define PRINT 1 -#define COPYIN 2 -#define COPYOUT 3 -#define UNCOPIN 4 -#define UNCOPOUT 5 -#define PIPE 6 -#define UNPIPE 7 -#define YES 8 -#define NO 9 -#define SUCCEED 10 -#define FAIL 11 -#define BYE 12 -#define LOG 13 -#define CHDIR 14 -#define LEARN 15 -#define MV 16 -#define USER 17 -#define NEXT 18 -#define SKIP 19 -#define WHERE 20 -#define MATCH 21 -#define NOP 22 -#define BAD 23 -#define CREATE 24 -#define CMP 25 -#define GOTO 26 -#define ONCE 27 - -extern int more; -extern char *level; -extern int speed; -extern char *sname; -extern char *direct; -extern char *todo; -extern int didok; -extern int sequence; -extern int comfile; -extern int status; -extern int wrong; -extern char *pwline; -extern char *dir; -extern FILE *incopy; -extern FILE *scrin; -extern int logging; -extern int ask; - -extern void intrpt(int); -extern void hangup(int); -extern void trim(char *); diff --git a/usr.bin/learn/src/pathnames.h b/usr.bin/learn/src/pathnames.h deleted file mode 100644 index bd875e396a0..00000000000 --- a/usr.bin/learn/src/pathnames.h +++ /dev/null @@ -1,6 +0,0 @@ -/* - * pathnames file for learn. - * $OpenBSD: pathnames.h,v 1.1 1998/09/28 16:40:17 ian Exp $ - */ - -#define _PATH_LLIB "/usr/share/learn" diff --git a/usr.bin/learn/src/tee.c b/usr.bin/learn/src/tee.c deleted file mode 100644 index 3913b4dfdef..00000000000 --- a/usr.bin/learn/src/tee.c +++ /dev/null @@ -1,72 +0,0 @@ -/* $OpenBSD: tee.c,v 1.4 2001/11/19 19:02:14 mpech Exp $ */ - -/* tee - copy stdin into .ocopy, for learn(1). */ - -/**************************************************************** -Copyright (C) AT&T 1995 -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of AT&T or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -AT&T DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL AT&T OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. -****************************************************************/ - -#include <stdlib.h> - -char *PS1; - -int -main() -{ - int f; - char c; - - PS1 = getenv("PS1"); - if (PS1==0) - PS1 = "$ "; - f = creat(".ocopy", 0666); - while (read(0, &c, 1) == 1) { - write (1, &c, 1); - put(c, f); - } - fl(f); - close(f); - return 0; -} - -static char ln[5120]; -char *p = ln; -put(c, f) -{ - *p++ = c; - if (c == '\n') { - fl(f); - p=ln; - } -} -fl(f) -{ - char *s; - - s = ln; - while (*s == '$' && *(s+1) == ' ') - s += 2; - if (strncmp(s, PS1, strlen(PS1)) == 0) - s += strlen(PS1); - write(f, s, p-s); -} |