Sydney S. Weinstein, CDP, CCP is a consultant, columnist, lecturer, author, professor, and President of Myxa Corporation, an Open Systems Technology company specializing in helping companies move to and work with Open Systems. He can be contacted care of Myxa Corporation, 3837 Byron Road, Huntingdon Valley, PA 19006-2320, or via electronic mail using the Internet/USENET mailbox syd@Myxa.com (dsinc!syd for those that cannot do Internet addressing).
As the UNIX system evolves, keeping track of processes becomes a complex task, involving variants in operating system behavior and available tools. One program that tracks processes, and teaches how the different UNIX flavors deal with process management, is skill from Jeff Forys <jeff@forys.cranbury.nj.us> as published in Volume 28, Issues 87-89. skill will send signals or re-nice processes given any combination of user names, ttys, commands, and pids. skill is a single program; it determines which action to take by examining argv[0], to see which name was used to invoke it.
More interesting than the tool itself is all the information that comes with it, which tells how most modern versions of UNIX give user programs access to the process-table information. This posting even includes instructions for determining how other flavors of UNIX might give access and how to port this task to those flavors of UNIX.
Covering more highlights from comp.sources.unix, work continues on a set of public reusable C functions that are not restricted by copyright. Lars Wirzenius <wirzeniu@cc.helsinki.fi> submitted publib-0.4 for Volume 28, Issues 104-107. publib is a library of reusable C functions. It consists of a build framework and library modules. The framework is the mechanism that actually compiles and installs the library. The modules are groups of library functions. The framework and modules have been separated partly to simplify the development and distribution of new library modules, partly to ease ports of the library to other systems. publib designates no "official" set of modules. The intent here is to encourage many parties to supply modules, so that the installer of the library can pick and choose between modules, and install only those of interest.
To fill this new library, Wirzenius also contributed liw-modules-0.4 for Volume 28, Issues 188-201. Included in this initial contribution:
UNIX's inetd can make any program into a server by connecting its stdin and stdout to sockets for access over the network. Regular users often find it useful to perform this same action to connect two programs over the network, extending the pipe concept from a single host to a network. netpipes-2.1 from Robert Forsman <thoth@cis.ufl.edu>provides this ability via two programs. Faucet is the server side. It listens on a port and forks processes for each connection. Hose is a one-shot program which connects a process to a server. The programs were contributed as Volume 28, Issue 205.
- alloc handles dynamic memory allocation
- bitarr implements a bit array
- cmp implements comparison functions for qsort(3), bsearch(3), and others having the same interface
- expr evaluates mathematical expressions given as strings
- files does various operations on files
- fname operates on UNIX/POSIX-style filenames
- hash implements a generic hashing table
- iset implements a set of long integers. iset is implemented as a linked list of ranges, which makes it more efficient if there are many dense parts in the set
- log implements a simple log file facility
- sbuf implements a text editor's editing buffer using a simple buffer gap data structure
- stack implements a generic stack
- strutil implements a number of more-or-less useful string and memory block operations
grep can extract lines with specific text from a file, but is not very useful to, say, grab that line and the next ten. head and tail can deal with the start and end of a file, but nothing in UNIX can deal with the middle. Well, now sect from Joe Shmoe <joeshmoe@world.std.com> can. sect was contributed for Volume 28, Issue 209. It can cut a section out of a file (or standard input). Users can specify an absolute start and end range, or a start and number of lines. Also, an all-but-the-range (inverse) option is available. Now if we can only combine that with grep, to deal with when we don't know the starting line. Any takers?
Lastly, rel is a program that determines the relevance of text documents to a set of keywords expressed in boolean infix notation. Submitted by John Conover <john@johncon.com> for Volume 28, Issue 212, it prints the list of file names that are relevant in order of their relevance. rel will help reduce text searches to likely files and will work both interactively and within servers and daemons.
Making it with jam
A new release of jam, a make-like program, appeared in Volume 47, Issues 108-114 of comp.sources.misc. jam recursively builds target files from their source files, using two files to define the dependency graph and the updating actions for all targets. The system-wide file Jambase defines the rules, and the file Jamfile lists the targets and sources in terms of those rules. jam does not need to rely on suffix-driven implicit rules or directory contents. jam provides a Jambase file; you supply the Jamfile.The author lists the advantages of Jam as follows:
On the patch front, patches were received for dist-3.0 from 58-60 and 96-97. These patches add new configuration modules and update the portability of some of the others. dist is a program that produces an automatic configuration file to adapt programs to different operating systems.
- jam is a make(1) replacement that makes building simple things simple and building complicated things manageable.
- jam's language is expressive, making Jamfiles (c.f. Makefiles) compact. jam handles header file dependencies automatically and on-the-fly.
- jam is very portable: it runs on UNIX, VMS, and NT. Most Jamfiles themselves are portable, leaving the specific system dependencies to the Jambase file.
- jam is unintrusive: it is small, it has negligible CPU overhead, and it doesn't create any of its own funny files.
- jam can build large projects spread across many directories in one pass, without recursing, tracking the relationships among all files. (See the paper that accompanies the posting.) On UNIX, jam can do this with multiple, concurrent processes.
ecu, the Extended Call UNIX utility from Warren Tucker <wht@n4hgf.atl.ga.us> received patch 3 in Voume 47, Issues 67-70. Patch 3 adds several bug fixes especially pertinent to RTS/CTS problems and the drivers.
CD still popular in X
With all the talk about new formats, CDs are still popular. So much so that people are still trying to use their CD-ROM drives to play audio CDs. Well, Ti Kan <ti@bazooka.amb.org> submitted xcmd_1.2 for Volume 22, Issues 142-159 of comp.sources.x. This new version includes xcmd, the X11/Motif-based CD player utility, and cda, the command-line driven non-graphical version. Supported features in this release:
Changes since the last release include support for more drive types and operating systems, creation of cda, the addition of play-on-load and eject-on-done attributes if desired, and a general reduction in window size footprint to conserve screen space.
- Standard functions: Stop, Play, Pause, Next/Previous Track, Next/Previous Index, Fast forward/rewind with audio sample, Eject, and On/off
- Direct track access keypad
- Volume control
- Track/Index/Time display: selectable to display elapsed time, remaining track time, or remaining disc time
- Status display: for current play status, A->B mode, program mode, CD database
- Shuffle (random) play function
- Repeat function
- Sample function: plays a few seconds of each track
- A->B function: repeats from selectable point A and B
- Eject inhibit function: to prevent someone from ejecting the disc by pressing the button on the drive
- Track Program function: plays tracks in custom order
- CD database function: allows you to store CD title/track titles in database, and associate each disc with a play program. Displays the current playing disc title/track information. In addition, you can enter and display arbitrary text associated with the disc or each track, such as band information, lyrics, etc.
- CD database entry send: contributes CD database entries to a central archive via Internet electronic mail
- Main window button face labels: these can be configured to display pictorial symbols, or text with hotkey mnemonics
- Keyboard operation, with full support for keyboard traversal and hotkeys
- Customizable labels and messages: customized to non-English languages via X resources in the .Xdefaults file
- User-Customizable colors and many other customizable functions using X resource settings
- On-line help information
- Attractive, intuitive Motif user interface
- Device-specific configuration files to make xmcd adaptible to various brands of CD-ROM drives
An extension server to convert the X protocol to PostScript for printing was contributed for Volume 22, Issues 97-99 by Matthew Reynolds <mreynold@qualcomm.com>. xpserv implements a printing model for X. xpserv is created as an extension to the X protocol using a second display. When you connect to the X server, use the extension to specify which window to print, send the Xlib calls to the server, close the window, and it outputs a PostScript file for printing.
A new release of xcb was issued by Farrell McKay <fbm@newt.phys.unsw.edu.au> for Volume 22 Issue 101. xcb provides a set of cut and paste buffers for your clipboard, allowing several pieces of text to be saved in the cut buffer and each retrieved separately. The new version fixes some minor bugs involving form widgits and multi-row resources and adds also some minor new features.
Gregg Hanna <gregor@kafka.saic.com> contributed a package, fontcvt, to manipulate X11 font specification strings for Volume 22, Issue 102. At the highest level, fontcvt provides a replacement font resource converter for Motif that doesn't give up so easily when it can't find a font. The resource converter instead relaxes the font specification until a good match is found. It's easy to install this converter in a Motif program.
A drawing utility for LaTeX \picture environments was released as xtexcad by Johannes Sixt <Johannes.Sixt@risc.uni-linz.ac.at> for Volume 22, Issues 103-107. XTeXcad reads and writes LaTeX \picture environments. The difficulty with LaTe X\pictures is that they only support a restricted set of slopes for lines and vectors and only a few diameters for circles. XTeXcad restricts the user to these during drawing. Besides lines and vectors, XTeXcad can also draw frames (solid and dashed), beziers, rectangles, and texts.
On the patch front, patch 10 was issued to xarchie in Volume 22, Issue 121. xarchie is an X front end to the archie anonymous FTP database. This patch fixes up some bugs and releases the latest list of archie servers. It was contributed by George Ferguson <ferguson@cs.rochester.edu>.