2

I'm going through the 'Unix Programming Environment' classic by Kernighan and Pike.

I discovered there was a very interesting command written by Kernighan and someone else called learn for computer aided instruction on Unix subjects like editing, macros and even C in version 7 and, it seems some of the BSD's. I've got a copy of Version 7 up and running in SimH to have a mess around with this stuff and it does indeed have a functioning learn command. However, it only gives the introduction, which asks you to choose a subject/lesson - when you type in 'files' etc, it just returns "sorry, there is no lesson named ..." or similar.

There ARE lessons, or files called files.a, macros.a in the /usr/lib/learn directory of the version I got from the simh website.

Does this mean I have to do some additional setup before the lessons are ready to use? Or, perhaps the lesson scripts aren't there in this copy? At the moment, I haven't yet created a new user, seeing as the default was dmr with no password.

Someone has asked about this before, but more in the direction of installing it on a modern system. Anyone know if there's a Unix I could use with simh that definitely does have this and with working lessons?

1

1 Answer 1

0

The answer to the linked question says that the lessons are available and are extracted by the Makefile. The bits of the makefile that are needed are

LESSONS = files editor morefiles macros eqn C
LLIB    = $(DESTDIR)/usr/lib/learn
lessons:    $(LESSONS)

$(LESSONS):
    -rm -r $(LLIB)/$@
    mkdir $(LLIB)/$@
    (cd $(LLIB)/$@; ar x ../[email protected])

If you want to do this manually, then for the files lessons you need to do

mkdir /usr/lib/learn/files
cd /usr/lib/learn/files
ar x ../files.a
4
  • better just chdir into the /usr/src/cmd/learn and do make lessons; make play; make log as instructed by the make command ;-)
    – user313992
    Jul 28, 2019 at 16:48
  • Thanks for your help to you both, I'll give this a go later. Sorry for not following up sooner, been away last couple of days. And apologies if the answer was a bit obvious, but I guess that's why I need the 'learn' command ;-) Aug 1, 2019 at 11:33
  • 1
    The above, shorter solution does indeed work. Been going through the lessons, and they're great. The 'files' one is short and sweet, but the 'editor' one, with plain, old ed is massive - and really got my brain working. Yes, no one needs to know ed, I'm sure, but it's all just as applicable to, say vi and goes through regular expressions and all sorts. Fun. :D Aug 9, 2019 at 19:45
  • This is how I learned UNIX back in 1983. It's great, and I'm surprised it doesn't exist on Linux any more. It was wonderful for mastering the : (colon) stuff in vi (now vim). I can :%s/string/replacement/ with ease, while my colleagues look on in jealousy.
    – Mike S
    Aug 24, 2022 at 16:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .