/sys/doc/ Documentation archive

A Tutorial for the Sam Command Language

By Rob Pike.

sam is an interactive text editor with a command language that makes heavy use of regular expressions. Although the language is syntactically similar to ed(1), the details are interestingly different. This tutorial introduces the command language, but does not discuss the screen and mouse interface. With apologies to those unfamiliar with the Ninth Edition Blit software, it is assumed that the similarity of sam to mux(9) at this level makes sam’s mouse language easy to learn.

The sam command language applies identically to two environments: when running sam on an ordinary terminal (via sam -d), and in the command window of a downloaded sam, that is, one using the bitmap display and mouse.

See Also