silvert@dalcs.UUCP (Bill Silvert) (05/03/85)
> Here are several utilities from Bourne's "The Unix System" and from > Kernighan & Pike's "The Unix Programming Environment". I have received several requests for information about the utilities field, pick, and zap, which I put on net.sources a while back. I didn't know that there were so many individuals without these books by Bourne, and by Kernighan & Pike! I didn't document the programs mainly because I felt it was a useful service to help others avoid having to type in several pages of listings, but I certainly don't want to discourage anyone from buying the books -- that would be a ripoff of the authors. Bourne's book actually includes the manual entry for field, but I haven't typed it into my machine, and I won't distribute it. Here is a brief description of what the utilities do, and what I have changed. If you want to know more, buy the books. field: filter which prints out the fields of its colon-separated input. Try a command like `field 1 6 4 5 < /etc/passwd' to see what it does. In fact, `field 1 </etc/passwd' is an easy way to get a list of users. pick: prints its arguments, then passes those you approve of to the standard output. Thus rm `pick *` is equivalent to rm -i *. I use it in constructions like mv `pick *` newdir to move most of the files in a directory to another. Answer y or n to pick. zap: interactive process killer. To kill background process with `word' in the command line type `zap command' and zap will list all processes with this word (including itself), and kill those you respond to with `y'. With no arguments, zap lists and can kill all of your processes. I have added a feature to zap -- if you are superuser, you can zap any process on the system! If not, it lists only your processes. By the way, Bourne suggests modifying field to accept certain options, such as using a separator other than a colon. I would find this useful, especially if the separator coudl be white space. If anyone has done this enhancement, I would appreciate a copy of the code. -- Bill Silvert Marine Ecology Lab. Dartmouth, NS dalcs!biomel!bill