JC's Miscellaneous Tools

JC's Miscellaneous Tools

This directory (~jc/src/misc) contains an assortment of useful programs, Most of the tools here are designed to be linked to the V ("verbose") package, so you might want to make first.


Next, if you are a new visitor, you might want to check out a few of the tools, to get an idea of the sort of things found here.

align
takes input that should be in columns, and adds spaces so that the columns line up. Columns may be left- or right-aligned, or centered.

chars
is a tool for generating arbitrary strings of characters based on their names or octal or hex values. It is designed to be used in scripts, to talk to other software that requires various sorts of untypable input.

box
draws several styles of boxes around its input.

clmr
is a general-purpose close of the Unix cp, ln, mv and rm commands, but much more programmer-friendly. They can be used in scripts without danger that the user will be harrassed by strange messages. Also, if called with a capitalized name, they will automatically back up target files that exist rather than overwriting them. It also implements the "lc" command, which attempts a link, and if that fails, does a copy instead.

factor
accepts an integer on its command line and output its prime factors.

ipad
returns addresses of hosts and interfaces. The output has no extraneous noise, so this command can be easily used in shell scripts.

mailfile
fixes email file-ownership problems that are common on many systems.

relink
searches through directories and file lists looking for identical files, and replaces them with links to a single file. This can result in significant savings of disk space, as well as putting multiple source trees back into sync.

slowcopy
is like cat(1), but copies the data in N-byte chunks, with S-second pauses between. This can be used in communication tests to generate data at a controlled rate.

sorthosts
accepts dotted-decimal notation and sorts it into increasing numeric order.

synclock
synchronizes clocks among networked machines. You can give it a list of host names or addresses, and your clock will be set to the mean value of those that respond. There is a "forever" option to repeat at a given interval.

tcpclient
is a prototype TCP client program, which establishes a connection to a server, exchanges a few messages, and shows you the results.

tcpserver
is a prototype TCP server program, which listens on a port, accepts connections and messages, and generates a few simple kinds of replies.

unixtime
accepts various sorts of dates and times on the command line or stdin, and outputs the corresponding Unix 32-bit timestamp.

xor
reads two files and outputs their results xor-ed together. This is useful as an "unbreakable" encryption tool, as well as a way of demonstrating that any file is an encryption of any other (so every web page and email message is actually encrypted pornography ;-).

Most of the programs here were written by John Chambers on an assortment of projects, often with a bit of help from friends and colleagues. Some of these programs duplicate tools that are found on some (but not all) Unix systems; having them here makes it easy to install them on a system where they don't exist. Some are clones of the standard Unix library programs, but with "improved" functionality. For example, see the "rm" command, which is useful in scripts because it doesn't harass the user like /bin/rm usually does these days. There's also a Rm that renames the files rather than unlinking them.

There is a Makefile entry to build the $(BIN) directory and fill it with the programs here. You should note that there are a few programs (addr, ping) here that need to be setuid or setgid; to make or install them, you need to be root.

The tar kit for this directory is made relative to this directory, so to unpack it, you should do something like:

mkdir misc cd misc zcat ../misc.tar.gz | tar xf - make test make install

Notes:

   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
   # First, before anything here will work, you need to create a #
   # local.h  file.  There are a number of *_local.h files here; #
   # pick one as a prototype and copy it to local.h;  then  edit #
   # local.h file to handle the system-dependent stuff.          #
   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
Most of the C code here has been "verbosized" in a way that may not be familiar to many C programmers. The main thing to note is that the "real" sources have .b as a suffix, not .c, and the Makefile builds the .c file from the .b file by running it through the b-c script. This is a rather trivial little script, really just a call of sed, but it's convenient to put it in a scrit. What it does is selects among the source lines with : in column 1. Such lines can be either included in the .c source or blanked out. This is a simpler and cleaner scheme than complex #ifdefs to make multiple versions from the same source. I mostly just use it to enable or disable the debug lines. This way, they take one line rather than three.

Most of the programs here use the V package. If you don't have it, go get it and build it, and then come back here. It should be found wherever you found the tar kit for the misc package. The best place to install it is in ../V/, i.e., next door to the misc package.

Next, edit the Makefile and make sure it's right for your system. Note in particular that it needs a pointer to wherever you have installed the V package.

To build the non-setuid programs, type: make make bin

To build the rest, become super-user and type: make install

There are also some test programs in the test subdirectory. You can run them all by typing make test Of course, you can just use this as the first make command.

Note that most of these use the ../V/libV.a library, which must be present or not much will link. Make sure that you have the V package compiled ...

There are some programs here that the "make all" entry doesn't build. They are typically the ones that are hopelessly system-dependent. You might look around after the make works, and see what odds and ends are of interest.

      Name                    Last modified       Size  Description

[DIR] Parent Directory 20-Apr-2004 11:54 - [TXT] Abox 28-Sep-2006 23:38 61k [TXT] Box 28-Sep-2006 23:38 61k [TXT] Bp 28-Sep-2006 23:38 89k [TXT] Cbox 28-Sep-2006 23:38 61k [TXT] Configure 28-Sep-2006 23:28 8k [TXT] Cp 28-Sep-2006 23:38 89k [TXT] Darwin_local.h 13-Apr-2004 16:31 1k [TXT] FREEBSD_local.h 28-Sep-2006 23:29 1k [TXT] Fp 28-Sep-2006 23:38 65k [TXT] FreeBSD_local.h 23-Dec-2003 10:28 1k [TXT] GPL.txt 11-May-2002 10:03 18k [TXT] Hex 28-Sep-2006 23:47 5k [TXT] Hex.b 19-Dec-1999 23:08 1k [TXT] Hex.c 13-Apr-2004 12:47 1k [TXT] Lc 28-Sep-2006 23:38 89k [   ] Lc.sh 24-Mar-2004 14:32 1k [TXT] LinkMy 17-Jan-2000 13:11 3k [TXT] Linux_local.h 13-Apr-2004 12:43 1k [TXT] Ln 28-Sep-2006 23:38 89k [   ] Ln.sh 19-Jan-2004 15:46 94k [TXT] Makefile 28-Sep-2006 23:02 54k [TXT] Mkdir 28-Sep-2006 23:47 59k [TXT] Mkdr 23-Dec-2003 11:34 55k [TXT] Mv 28-Sep-2006 23:38 89k [TXT] Rm 28-Sep-2006 23:47 64k [TXT] Rm.b 06-Dec-1999 12:32 1k [TXT] Rm.c 20-Sep-2005 16:30 1k [TXT] Rs 28-Sep-2006 23:38 89k [TXT] Sbox 28-Sep-2006 23:38 61k [TXT] SunOS_local.h 17-Dec-2003 15:08 1k [TXT] Test 28-Apr-2003 10:12 10k [TXT] Tester 01-Oct-2002 09:20 10k [TXT] V.h 23-Dec-2003 10:30 38k [TXT] V_A_UC.h 17-Dec-2003 15:08 1k [TXT] V_D_UC.h 17-Dec-2003 15:08 1k [TXT] V_M_UC.h 06-Dec-1999 12:32 1k [TXT] V_S_UC.h 06-Dec-1999 12:32 1k [TXT] V_X_UC.h 06-Dec-1999 12:32 1k [TXT] V___lc.h 06-Dec-1999 12:32 1k [TXT] V_s_lc.h 06-Dec-1999 12:32 1k [TXT] V_t_lc.h 06-Dec-1999 12:32 1k [TXT] V_x_lc.h 06-Dec-1999 12:32 1k [TXT] Which 23-Dec-2003 11:34 57k [TXT] abbr.h 17-Dec-2003 15:08 4k [TXT] abox 28-Sep-2006 23:38 61k [TXT] addr.b 23-Dec-2003 11:42 20k [TXT] ae 28-Sep-2006 23:47 5k [TXT] ae.b 19-Dec-1999 23:08 1k [TXT] ae.c 19-Dec-1999 23:08 1k [TXT] aix_errno.h 17-Dec-2003 15:08 8k [TXT] aix_local.h 17-Dec-2003 15:08 7k [TXT] align 28-Sep-2006 23:47 60k [TXT] align.b 05-Jun-2000 00:00 12k [TXT] align.c 20-Sep-2005 16:30 12k [TXT] args 28-Sep-2006 23:47 5k [TXT] args.b 19-Dec-1999 23:08 1k [TXT] args.c 19-Dec-1999 23:08 1k [TXT] asc 28-Sep-2006 23:47 5k [TXT] asc.b 19-Dec-1999 23:08 1k [TXT] asc.c 19-Dec-1999 23:08 1k [TXT] ascii.h 18-Feb-1993 11:25 3k [TXT] b7 28-Sep-2006 23:47 45k [TXT] b7.b 06-Dec-1999 12:32 1k [TXT] b7.c 20-Sep-2005 16:30 1k [TXT] bar 24-Mar-2004 14:30 0k [TXT] box 28-Sep-2006 23:38 61k [TXT] box.b 17-Dec-2003 16:24 11k [TXT] box.c 20-Sep-2005 16:29 11k [TXT] bp 28-Sep-2006 23:38 89k [TXT] bp.b 06-Dec-1999 12:32 2k [TXT] bsplit 28-Sep-2006 23:47 7k [TXT] bsplit.b 28-Sep-2006 23:10 2k [TXT] bsplit.c 28-Sep-2006 23:10 2k [TXT] btags 14-Apr-2004 18:15 41k [TXT] byteyears 28-Sep-2006 23:47 59k [TXT] byteyears.b 12-Dec-2005 11:32 4k [TXT] byteyears.c 12-Dec-2005 11:32 4k [TXT] call 28-Sep-2006 23:47 55k [TXT] call.b 05-Jun-2000 00:00 2k [TXT] call.c 20-Sep-2005 16:30 2k [TXT] cbox 28-Sep-2006 23:38 61k [TXT] chars 28-Sep-2006 23:47 59k [TXT] chars.b 05-Jun-2000 00:00 4k [TXT] chars.c 20-Sep-2005 16:30 4k [TXT] charset 28-Sep-2006 22:53 11k [TXT] charset.b 06-Dec-1999 12:38 1k [TXT] charset.c 06-Dec-1999 12:38 1k [TXT] clmr 28-Sep-2006 23:38 89k [TXT] clmr.b 05-Jun-2000 00:00 32k [TXT] clmr.c 20-Sep-2005 16:29 32k [TXT] conn 28-Sep-2006 23:47 84k [TXT] conn.b 06-Dec-1999 12:32 5k [TXT] conn.c 20-Sep-2005 16:30 5k [TXT] connsig.b 06-Dec-1999 12:32 14k [TXT] connsig.c 06-Dec-1999 12:38 14k [TXT] copyright.h 03-Dec-1999 14:20 1k [TXT] count 28-Sep-2006 23:47 45k [TXT] count.b 23-Dec-2003 11:00 1k [TXT] count.c 20-Sep-2005 16:30 1k [TXT] cp 28-Sep-2006 23:38 89k [TXT] cputype 28-Sep-2006 23:47 4k [TXT] cputype.b 06-Dec-1999 12:32 1k [TXT] cputype.c 20-Sep-2005 16:30 1k [TXT] ctags 14-Apr-2004 18:15 41k [TXT] cut 28-Sep-2006 23:47 7k [TXT] cut.b 05-Jun-2000 00:00 3k [TXT] cut.c 20-Sep-2005 16:30 3k [TXT] cv_local.h 08-Dec-1999 18:41 1k [TXT] da.h 17-Dec-2003 15:08 1k [TXT] dbgA.h 08-Dec-1999 18:41 1k [TXT] dbgD.h 08-Dec-1999 18:41 1k [TXT] dbgM.h 08-Dec-1999 18:41 1k [TXT] dbgS.h 08-Dec-1999 18:41 1k [TXT] dbgX.h 08-Dec-1999 18:41 1k [TXT] dbg_.h 08-Dec-1999 18:41 1k [TXT] dbgs.h 08-Dec-1999 18:41 1k [TXT] dbgt.h 08-Dec-1999 18:41 1k [TXT] dbgx.h 08-Dec-1999 18:41 1k [TXT] detab 28-Sep-2006 23:47 6k [TXT] detab.b 06-Dec-1999 12:32 2k [TXT] detab.c 20-Sep-2005 16:30 2k [TXT] dirnam 28-Sep-2006 23:47 5k [TXT] dirnam.b 05-Jun-2000 00:00 1k [TXT] dirnam.c 20-Sep-2005 16:30 1k [TXT] dmp.h 17-Dec-2003 15:08 3k [TXT] dmp_ip.b 17-Mar-2003 09:58 6k [TXT] dmp_ip.c 20-Sep-2005 16:29 6k [TXT] dump.b 17-Mar-2003 09:58 6k [TXT] dump.c 20-Sep-2005 16:29 6k [TXT] duplen 28-Sep-2006 23:47 5k [TXT] duplen.b 05-Jun-2000 00:00 1k [TXT] duplen.c 20-Sep-2005 16:30 1k [TXT] env 28-Sep-2006 23:47 5k [TXT] env.b 19-Dec-1999 23:08 1k [TXT] env.c 19-Dec-1999 23:08 1k [TXT] err.c 06-Dec-1999 12:37 4k [TXT] err.h 17-Dec-2003 15:08 1k [TXT] errnotbl 12-Dec-1995 17:04 5k [TXT] exit.h 17-Dec-2003 15:08 1k [TXT] extern.h 17-Dec-2003 15:08 3k [TXT] factor 28-Sep-2006 23:47 5k [TXT] factor.b 19-Dec-1999 23:08 1k [TXT] factor.c 19-Dec-1999 23:08 1k [TXT] false 20-Sep-2005 16:30 11k [TXT] false.b 19-Dec-1999 23:08 1k [TXT] false.c 19-Dec-1999 23:08 1k [TXT] fc 28-Sep-2006 23:38 65k [TXT] fh 28-Sep-2006 23:38 65k [TXT] findsb.b 05-Jun-2000 00:00 3k [TXT] findsb.c 14-Apr-2004 18:15 3k [TXT] finfo 28-Sep-2006 23:47 55k [TXT] finfo.b 05-Jun-2000 00:00 4k [TXT] finfo.c 20-Sep-2005 16:30 4k [TXT] foo 24-Mar-2004 14:30 0k [TXT] fp 28-Sep-2006 23:38 65k [TXT] fp.b 17-Dec-2003 16:03 22k [TXT] fp.c 20-Sep-2005 16:30 21k [TXT] fp.h 06-Dec-1999 12:32 1k [TXT] gdbm.h 22-Aug-1995 17:09 5k [DIR] gdbm/ 24-Oct-2007 17:17 - [TXT] gdbmsrvr 28-Sep-2006 23:47 82k [TXT] gdbmsrvr.b 17-Dec-2003 16:10 11k [TXT] gdbmsrvr.c 20-Sep-2005 16:30 11k [TXT] gdbmsrvr.h 06-Dec-1999 12:32 1k [TXT] gdbmtest 28-Sep-2006 23:47 73k [TXT] gdbmtest.b 05-Jun-2000 00:00 13k [TXT] gdbmtest.c 20-Sep-2005 16:30 13k [TXT] getdate.c 05-Jun-2000 00:00 40k [TXT] getdate.y 01-Apr-1996 18:11 23k [TXT] goedel 28-Sep-2006 23:47 5k [TXT] goedel.b 19-Dec-1999 23:08 1k [TXT] goedel.c 19-Dec-1999 23:08 1k [TXT] hd 28-Sep-2006 23:47 59k [TXT] hd.b 06-Dec-1999 12:32 3k [TXT] hd.c 20-Sep-2005 16:30 3k [TXT] hello 20-Sep-2005 16:30 11k [TXT] hello.b 06-Dec-1999 12:38 1k [TXT] hello.c 06-Dec-1999 12:38 1k [TXT] hex 28-Sep-2006 23:47 5k [TXT] hex.b 13-Apr-2004 12:47 1k [TXT] hex.c 13-Apr-2004 12:47 1k [TXT] hexdate.b 17-Apr-1998 15:56 1k [TXT] hosttype 28-Sep-2006 23:47 4k [TXT] hosttype.b 24-Mar-2004 14:44 1k [TXT] hosttype.c 24-Mar-2004 14:44 1k [TXT] icmp.b 05-Jun-2000 00:00 13k [TXT] icmp.c 14-Apr-2004 18:15 13k [TXT] icmp.h 13-Apr-2004 12:16 10k [TXT] ifdflt.h 17-Mar-2003 09:57 1k [TXT] ip.h 07-Apr-2000 10:21 5k [TXT] ip2hex 28-Apr-2001 22:46 5k [TXT] ip2hex.b 28-Apr-2001 22:46 1k [TXT] ip2hex.c 28-Apr-2001 22:46 1k [TXT] ip2hex.pl 28-Apr-2001 23:06 1k [TXT] ipad 28-Sep-2006 23:38 73k [TXT] ipad.b 23-Dec-2003 11:42 20k [TXT] ipad.c 20-Sep-2005 16:30 20k [TXT] iphdr.h 18-May-2005 23:16 7k [TXT] jabber 28-Sep-2006 23:47 5k [TXT] jabber.b 19-Dec-1999 23:08 1k [TXT] jabber.c 19-Dec-1999 23:08 1k [TXT] kendy_Linux_local.h 22-Feb-2002 21:47 1k [TXT] laman.b 08-Dec-1999 19:19 1k [TXT] laman.c 14-Apr-2004 18:15 1k [TXT] lastarg 28-Sep-2006 23:47 5k [TXT] lastarg.b 19-Dec-1999 23:08 1k [TXT] lastarg.c 19-Dec-1999 23:08 1k [TXT] lastfld.b 06-Dec-1999 12:32 1k [TXT] lastfld.c 20-Sep-2005 16:29 1k [TXT] lc 28-Sep-2006 23:38 89k [TXT] line.b 05-Jun-2000 00:00 1k [TXT] line.c 14-Apr-2004 18:15 1k [TXT] line100 18-Jun-2002 09:21 1k [TXT] line120 16-Sep-2002 14:39 1k [TXT] line160 16-Sep-2002 14:39 1k [TXT] line64 09-Mar-2003 10:57 1k [TXT] line72 09-Mar-2003 10:56 1k [TXT] line80 17-Dec-2003 15:47 1k [TXT] line99 16-Sep-2002 14:39 1k [TXT] linux_local.h 06-Dec-1999 12:32 7k [TXT] ln 28-Sep-2006 23:38 89k [TXT] local.mk 17-Apr-1998 14:17 1k [TXT] machtype 28-Sep-2006 23:47 4k [TXT] machtype.b 17-Apr-1998 15:56 1k [TXT] machtype.c 17-Apr-1998 15:56 1k [TXT] mailfile 28-Sep-2006 23:47 54k [TXT] mailfile.b 06-Dec-1999 12:32 2k [TXT] mailfile.c 20-Sep-2005 16:30 2k [TXT] makeraw.b 28-Sep-2006 23:10 12k [TXT] makeraw.c 28-Sep-2006 23:10 11k [TXT] makeraw.c.save 24-Mar-2004 13:54 11k [TXT] makesane.b 13-Apr-2004 10:29 14k [TXT] makesane.b.save 24-Mar-2004 14:12 14k [TXT] makesane.c 20-Sep-2005 16:29 14k [DIR] man/ 13-Apr-2004 11:49 - [TXT] mbox.h 30-Jun-1994 09:48 2k [TXT] mem.h 11-Sep-2003 18:48 7k [TXT] memchunk.h 23-Dec-2003 11:02 6k [TXT] minrand.b 08-Dec-1999 17:39 3k [TXT] minrand.c 08-Dec-1999 17:39 3k [TXT] minrand.h 17-Dec-2003 15:08 1k [TXT] misc.README 31-Mar-2000 10:21 4k [TXT] misc.b 05-Jun-2000 00:00 2k [TXT] misc.c 20-Sep-2005 16:29 1k [TXT] mkdir 19-Jan-2004 15:46 63k [TXT] mkdir.b 05-Jun-2000 00:00 5k [TXT] mkdir.c 19-Jan-2004 15:40 5k [TXT] mkdr 28-Sep-2006 23:47 59k [TXT] mkdr.b 23-Dec-2003 11:22 5k [TXT] mkdr.c 20-Sep-2005 16:30 5k [TXT] mod 28-Sep-2006 23:47 56k [TXT] mod.b 06-Dec-1999 12:32 3k [TXT] mod.c 20-Sep-2005 16:30 2k [TXT] mv 28-Sep-2006 23:38 89k [TXT] nbiotest 28-Sep-2006 23:47 54k [TXT] nbiotest.b 06-Dec-1999 12:32 1k [TXT] nbiotest.c 20-Sep-2005 16:30 1k [TXT] newer 28-Sep-2006 23:47 54k [TXT] newer.b 05-Jun-2000 00:00 1k [TXT] newer.c 20-Sep-2005 16:30 1k [TXT] newtype 28-Sep-2006 23:47 64k [TXT] newtype.b 05-Jun-2000 00:00 4k [TXT] newtype.c 20-Sep-2005 16:30 4k [TXT] nonnumeric.b 08-Dec-1999 19:19 1k [TXT] nonnumeric.c 14-Apr-2004 18:15 1k [TXT] nop 20-Sep-2005 16:30 11k [TXT] nop.b 19-Dec-1999 23:08 1k [TXT] nop.c 19-Dec-1999 23:08 1k [TXT] numtest.b 08-Dec-1999 19:19 1k [TXT] numtest.c 08-Dec-1999 19:19 1k [DIR] old/ 17-Apr-2004 19:32 - [TXT] older 28-Sep-2006 23:47 54k [TXT] older.b 05-Jun-2000 00:00 1k [TXT] older.c 20-Sep-2005 16:30 1k [TXT] open.b 17-Apr-1998 15:57 1k [TXT] osf1_local.h 17-Dec-2003 15:08 7k [TXT] overwrite 28-Sep-2006 23:47 59k [TXT] overwrite.b 05-Jun-2000 00:00 4k [TXT] overwrite.c 20-Sep-2005 16:30 4k [TXT] p34 28-Sep-2006 23:47 59k [TXT] p34.b 06-Dec-1999 12:32 1k [TXT] p34.c 20-Sep-2005 16:30 1k [TXT] p43 28-Sep-2006 23:47 59k [TXT] p43.b 06-Dec-1999 12:32 1k [TXT] p43.c 20-Sep-2005 16:30 1k [TXT] page 28-Sep-2006 23:47 8k [TXT] page.b 05-Jun-2000 00:00 3k [TXT] page.c 20-Sep-2005 16:30 3k [TXT] pc_local.h 08-Dec-1999 18:41 3k [TXT] perror 28-Sep-2006 23:47 54k [TXT] perror.b 06-Dec-1999 12:32 1k [TXT] perror.c 20-Sep-2005 16:30 1k [TXT] ping 31-Aug-2005 11:43 77k [TXT] ping.b 17-Mar-2003 09:57 14k [TXT] ping.c 31-Aug-2005 11:43 14k [TXT] pktime.b 05-Jun-2000 00:00 3k [TXT] pktime.c 20-Sep-2005 16:29 3k [TXT] pktime.h 06-Dec-1999 12:32 1k [TXT] pkunpk.b 23-Dec-2003 11:01 3k [TXT] pkunpk.c 20-Sep-2005 16:30 3k [DIR] pl/ 13-Apr-2004 11:49 - [TXT] proto.b 06-Dec-1999 12:32 1k [TXT] proto.c 14-Apr-2004 18:15 1k [TXT] proxy 28-Sep-2006 23:47 85k [TXT] proxy.b 05-Jun-2000 00:00 22k [TXT] proxy.c 20-Sep-2005 16:30 21k [TXT] quel 28-Sep-2006 23:47 59k [TXT] quel.b 05-Jun-2000 00:00 10k [TXT] quel.c 02-Sep-2003 00:13 9k [TXT] randline 28-Sep-2006 23:47 55k [TXT] randline.b 05-Jun-2000 00:00 1k [TXT] randline.c 20-Sep-2005 16:30 1k [TXT] relink 28-Sep-2006 23:47 68k [TXT] relink.b 28-Sep-2006 23:42 26k [TXT] relink.c 28-Sep-2006 23:42 25k [TXT] rm 28-Sep-2006 23:38 89k [TXT] rowbytesum 28-Sep-2006 23:47 5k [TXT] rowbytesum.b 19-Dec-1999 23:09 1k [TXT] rowbytesum.c 19-Dec-1999 23:09 1k [TXT] rowbytesum.data 24-Jun-1997 19:22 1k [TXT] rs 28-Sep-2006 23:38 89k [TXT] rs.b 05-Jun-2000 00:00 8k [TXT] rs.c 20-Sep-2005 16:30 8k [TXT] say 28-Sep-2006 23:47 60k [TXT] say.b 05-Jun-2000 00:00 13k [TXT] say.c 20-Sep-2005 16:30 13k [TXT] saying 28-Sep-2006 23:47 60k [TXT] saying.b 05-Jun-2000 00:00 4k [TXT] saying.c 20-Sep-2005 16:30 4k [TXT] sbox 31-Aug-2005 11:39 65k [TXT] sel 28-Sep-2006 23:47 55k [TXT] sel.b 17-Dec-2003 15:27 6k [TXT] sel.c 20-Sep-2005 16:30 6k [TXT] sgtty.h 24-Feb-1993 21:12 1k [DIR] sh./ 29-Aug-2007 11:30 - [DIR] sh.FREEBSD/ 29-Aug-2007 11:30 - [DIR] sh.FreeBSD/ 29-Aug-2007 11:30 - [DIR] sh.SunOS/ 06-Mar-2003 22:52 - [DIR] sh.aix/ 06-Mar-2003 22:52 - [DIR] sh.bsd/ 06-Mar-2003 22:52 - [DIR] sh.esix4/ 06-Mar-2003 22:52 - [DIR] sh.freebsd/ 29-Aug-2007 11:30 - [DIR] sh.i586/ 08-Dec-1999 19:55 - [DIR] sh.linux/ 06-Mar-2003 22:52 - [DIR] sh.sun4/ 06-Mar-2003 22:52 - [DIR] sh.sys5/ 06-Mar-2003 22:52 - [DIR] sh.vax4/ 06-Mar-2003 22:52 - [DIR] sh/ 29-Aug-2007 11:30 - [TXT] slowcopy 28-Sep-2006 23:47 59k [TXT] slowcopy.b 05-Jun-2000 00:00 2k [TXT] slowcopy.c 20-Sep-2005 16:30 2k [TXT] sorthosts 28-Sep-2006 23:47 55k [TXT] sorthosts.b 05-Jun-2000 00:00 3k [TXT] sorthosts.c 20-Sep-2005 16:30 3k [TXT] spin 28-Sep-2006 23:47 6k [TXT] spin.b 05-Jun-2000 00:00 1k [TXT] spin.c 20-Sep-2005 16:30 1k [TXT] split.b 06-Dec-1999 12:32 2k [TXT] split.c 20-Sep-2005 16:29 2k [TXT] srvr.h 17-Dec-2003 15:08 1k [TXT] stGHnGpJ 14-Dec-2002 17:31 0k [TXT] stdarg.h 15-Jul-1991 12:34 1k [TXT] str.b 17-Dec-2003 15:13 13k [TXT] str.c 20-Sep-2005 16:29 13k [TXT] str.h 03-Jun-2003 09:47 20k [TXT] strcmp 28-Sep-2006 23:47 5k [TXT] strcmp.b 05-Jun-2000 00:00 1k [TXT] strcmp.c 05-Jun-2000 00:00 1k [TXT] stripman 28-Sep-2006 23:47 7k [TXT] stripman.b 19-Dec-1999 23:09 1k [TXT] stripman.c 19-Dec-1999 23:09 1k [TXT] sucmd.b 05-Jun-2000 00:00 1k [TXT] sucmd.c 05-Jun-2000 00:00 1k [TXT] symtime 28-Sep-2006 23:47 55k [TXT] symtime.b 06-Dec-1999 12:32 4k [TXT] symtime.c 20-Sep-2005 16:30 4k [TXT] synclock 28-Sep-2006 23:47 83k [TXT] synclock.b 05-Jun-2000 00:00 15k [TXT] synclock.c 20-Sep-2005 16:30 15k [TXT] sys.h 11-Sep-2003 18:48 6k [TXT] sys_ctype.h 07-Jan-2003 13:00 1k [TXT] sys_dir.h 17-Dec-2003 15:08 2k [TXT] sys_errno.h 24-Mar-2004 15:00 1k [TXT] sys_fcntl.h 17-Dec-2003 15:08 1k [TXT] sys_file.h 17-Dec-2003 15:08 1k [TXT] sys_fs.h 01-Apr-1996 16:20 1k [TXT] sys_if.h 13-Apr-2004 10:02 1k [TXT] sys_in.h 13-Apr-2004 15:41 1k [TXT] sys_in_systm.h 17-Dec-2003 15:08 1k [TXT] sys_ioctl.h 17-Dec-2003 15:16 1k [TXT] sys_ip.h 13-Apr-2004 12:16 1k [TXT] sys_ip_icmp.h 29-Mar-2000 13:52 1k [TXT] sys_ip_imcp.h 19-Jan-1993 15:33 1k [TXT] sys_limits.h 19-Jan-1993 15:43 1k [TXT] sys_malloc.h 28-Sep-2006 23:05 1k [TXT] sys_mount.h 19-Jan-1993 15:40 1k [TXT] sys_netdb.h 17-Dec-2003 15:08 1k [TXT] sys_param.h 17-Dec-2003 15:08 1k [TXT] sys_pcb.h 13-Apr-2004 12:16 1k [TXT] sys_poll.h 06-Dec-1999 12:28 1k [TXT] sys_pthreads.h 17-Dec-2003 15:08 1k [TXT] sys_pwd.h 18-Feb-1993 11:17 1k [TXT] sys_resource.h 17-Dec-2003 15:08 1k [TXT] sys_route.h 25-Oct-1995 16:05 1k [TXT] sys_select.h 28-Sep-2006 23:31 1k [TXT] sys_sgtty.h 07-Jun-1993 10:12 1k [TXT] sys_signal.h 17-Dec-2003 15:08 1k [TXT] sys_socket.h 17-Dec-2003 15:23 1k [TXT] sys_stat.h 17-Dec-2003 15:08 1k [TXT] sys_stdio.h 28-Sep-2006 10:12 2k [TXT] sys_stdlib.h 17-Dec-2003 15:08 1k [TXT] sys_stream.h 09-Mar-1995 14:17 1k [TXT] sys_string.h 17-Dec-2003 16:07 1k [TXT] sys_sys_utime.h.h 12-Dec-1995 21:26 1k [TXT] sys_syslog.h 19-Jan-1993 15:20 1k [TXT] sys_sysmacros.h 17-Mar-2003 09:57 1k [TXT] sys_tcp.h 17-Dec-2003 15:08 1k [TXT] sys_termio.h 06-Dec-1999 12:28 1k [TXT] sys_termios.h 01-Feb-1999 10:29 1k [TXT] sys_time.h 07-Jan-2003 13:00 3k [TXT] sys_types.h 24-Mar-2004 14:41 2k [TXT] sys_udp.h 17-Dec-2003 15:08 1k [TXT] sys_utime.h 07-Apr-2000 10:39 1k [TXT] sys_utsname.h 17-Dec-2003 15:08 1k [TXT] sys_values.h 28-Sep-2006 23:15 1k [TXT] sys_varargs.h 13-Apr-2004 12:38 1k [TXT] sys_wait.h 17-Dec-2003 15:08 1k [TXT] sys_wait3.h 19-Jan-1993 15:37 1k [TXT] syslog.h 04-Dec-1990 13:40 3k [TXT] systype 28-Sep-2006 23:47 5k [TXT] systype.b 05-Jun-2000 00:00 1k [TXT] systype.c 05-Jun-2000 00:00 1k [TXT] t_alarm 28-Sep-2006 23:47 5k [TXT] t_alarm.b 11-Jun-2004 09:46 1k [TXT] t_alarm.c 11-Jun-2004 09:46 1k [TXT] taillog 28-Sep-2006 23:47 66k [TXT] taillog.b 23-Dec-2003 11:05 9k [TXT] taillog.c 20-Sep-2005 16:30 9k [TXT] tarkit 10-Feb-1998 07:33 0k [TXT] tcpclient 28-Sep-2006 23:47 64k [TXT] tcpclient.b 05-Jun-2000 00:00 6k [TXT] tcpclient.c 20-Sep-2005 16:30 6k [TXT] tcpproxy 28-Sep-2006 23:47 69k [TXT] tcpproxy.b 05-Jun-2000 00:00 7k [TXT] tcpproxy.c 20-Sep-2005 16:30 7k [TXT] tcpserver 28-Sep-2006 23:47 69k [TXT] tcpserver.b 05-Jun-2000 00:00 10k [TXT] tcpserver.c 20-Sep-2005 16:30 10k [TXT] tee 28-Sep-2006 23:47 60k [TXT] tee.b 05-Jun-2000 00:00 4k [TXT] tee.c 20-Sep-2005 16:30 4k [TXT] termio.h 06-Dec-1999 12:28 1k [TXT] termios.h 01-Feb-1999 10:29 1k [DIR] test/ 17-Dec-2003 15:54 - [TXT] testdir.b 05-Jun-2000 00:00 1k [TXT] testfloat 28-Sep-2006 23:47 54k [TXT] testfloat.b 06-Dec-1999 12:32 1k [TXT] testfloat.c 20-Sep-2005 16:30 1k [TXT] testrand 28-Sep-2006 23:47 54k [TXT] testrand.b 19-Dec-1999 23:09 1k [TXT] testrand.c 19-Dec-1999 23:09 1k [TXT] tests 28-Sep-2006 23:47 0k [TXT] timestamp 28-Sep-2006 23:47 5k [TXT] timestamp.b 19-Dec-1999 23:09 1k [TXT] timestamp.c 19-Dec-1999 23:09 1k [TXT] tmp 17-Dec-2003 15:12 1k [TXT] tmp1 01-May-2000 16:06 1k [TXT] tmp1a 01-May-2000 16:25 1k [TXT] tnd3_local.h 17-Dec-2003 15:08 4k [TXT] to 28-Sep-2006 23:47 59k [TXT] to.b 05-Jun-2000 00:00 6k [TXT] to.c 20-Sep-2005 16:30 6k [TXT] trillian_freebsd_loc..> 13-Apr-2004 10:29 7k [TXT] trllian_local.h 13-Apr-2004 10:02 1k [TXT] true 20-Sep-2005 16:30 11k [TXT] true.b 19-Dec-1999 23:09 1k [TXT] true.c 19-Dec-1999 23:09 1k [TXT] u8dump 28-Sep-2006 23:54 59k [TXT] u8dump.b 28-Sep-2006 23:54 7k [TXT] u8dump.c 28-Sep-2006 23:54 7k [TXT] u8dump1.txt 28-Sep-2006 09:44 1k [TXT] u8dump2.txt 28-Sep-2006 09:22 1k [TXT] u8dump3.txt 20-Feb-2007 07:07 1k [TXT] u8dump4.txt 28-Sep-2006 15:02 2k [TXT] udpclient 28-Sep-2006 23:47 65k [TXT] udpclient.b 20-Sep-2005 17:07 6k [TXT] udpclient.c 28-Sep-2006 22:54 6k [TXT] udpserver 28-Sep-2006 23:47 66k [TXT] udpserver.b 20-Sep-2005 17:13 6k [TXT] udpserver.c 28-Sep-2006 22:54 6k [TXT] unixtime 28-Sep-2006 23:47 66k [TXT] unixtime.b 06-Dec-1999 12:32 1k [TXT] unixtime.c 20-Sep-2005 16:30 1k [TXT] unlink 28-Sep-2006 23:47 54k [TXT] unlink.b 06-Dec-1999 12:32 1k [TXT] unlink.c 20-Sep-2005 16:30 1k [TXT] unpackmail.b 06-Dec-1999 12:32 6k [TXT] unpackmail.c 14-Apr-2004 18:15 6k [TXT] unqp 28-Sep-2006 23:47 54k [TXT] unqp.b 31-Aug-2005 11:51 2k [TXT] unqp.c 20-Sep-2005 16:30 2k [TXT] utsname 28-Sep-2006 23:47 6k [TXT] utsname.b 28-Sep-2006 23:33 1k [TXT] utsname.c 28-Sep-2006 23:33 1k [TXT] uudecode 28-Sep-2006 23:47 7k [TXT] uudecode.b 19-Dec-1999 23:09 4k [TXT] uudecode.c 19-Dec-1999 23:09 4k [TXT] uuencode 28-Sep-2006 23:47 7k [TXT] uuencode.b 19-Dec-1999 23:09 3k [TXT] uuencode.c 19-Dec-1999 23:09 3k [TXT] verbose.h 23-Dec-2003 10:30 38k [TXT] which 23-Dec-2003 11:34 57k [TXT] which.b 05-Jun-2000 00:00 10k [TXT] which.c 02-Sep-2003 00:13 9k [TXT] wrapper 28-Sep-2006 23:47 59k [TXT] wrapper.b 06-Dec-1999 12:32 1k [TXT] wrapper.c 20-Sep-2005 16:30 1k [TXT] wrappers.h 08-Feb-1994 20:39 0k [TXT] xd 28-Sep-2006 23:47 59k [TXT] xd.b 06-Dec-1999 12:32 1k [TXT] xd.c 20-Sep-2005 16:30 1k [TXT] xenix_local.h 17-Dec-2003 15:08 3k [TXT] xor 20-Sep-2005 16:30 15k [TXT] xor.b 05-Jun-2000 00:00 4k [TXT] xor.c 05-Jun-2000 00:00 4k

#!/bin/sh

# This directory (~jc/misc) contains an assortment of useful programs,

# Most of the programs here were  written  by  John  Chambers  on  an
# assortment  of  projects, often with a bit of help from friends and
# colleagues.  Some of these programs duplicate tools that are  found
# on  some (but not all) Unix systems; having them here makes it easy
# to install them on a system where they don't exist. Some are clones
# of   the  standard  Unix  library  programs,  but  with  "improved"
# functionality.  For example, see the "rm" command, which is  useful
# in  scripts because it doesn't harass the user like /bin/rm usually
# does these days.  There's also a Rm that renames the  files  rather
# than unlinking them.

# There is a Makefile entry to build the $(BIN) directory and fill  it
# with  the  programs  here.   You  should  note  that there are a few
# programs (addr, ping) here that need to be setuid or setgid; to make
# or install them, you need to be root.

# The tar kit for the misc directory is made relative to  the  parent,
# directory so to unpack it, you should do something like:

     gunzip <misc.tar.gz | tar xf -
     cd    misc
	 make
     make  test
     make  install

# Notes:
#    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
#    # The V package is used by nearly everything in misc, so  you #
#    # will  want  to unpack it first.  If V and misc are adjacent #
#    # directories, then you can do a make inside misc and it will #
#    # cd to ../V and do a make there.                             #
#    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
#    # First, before anything here will work, you need to create a #
#    # local.h  file.  There are a number of *_local.h files here; #
#    # pick one as a prototype and copy it to local.d;  then  edit #
#    # local.h file to handle the system-dependent stuff.          #
#    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

# Most of the C code here has been "dbgized" in a way that may not be
# familiar to many C programmers.  The main thing to note is that the
# "real" sources have .b as a suffix, not .c, and the Makefile builds
# the  .c file from the .b file by running it through the b-c script.
# This is a rather trivial little script, really just a call of  sed,
# but  it's convenient to put it in a scrit.  What it does is selects
# among the source lines with : in column 1. Such lines can be either
# included  in  the  .c source or blanked out.  This is a simpler and
# cleaner scheme than complex #ifdefs to make multiple versions  from
# the  same  source.   I  mostly just use it to enable or disable the
# debug lines.  This way, they take one line rather than three.

# Most of the programs here use the dbg package. If you don't have it,
# go get it and build it, and then come back here.  It should be found
# wherever you found the tar kit for the misc package.  The best place
# to install it is in ../dbg, i.e., next door to the misc package.

# Next, edit the Makefile and make sure it's right  for  your  system.
# Note  in  particular  that  it  needs a pointer to wherever you have
# installed the dbg package.

# To build the non-setuid programs, type:
# 	make
# 	make bin

# To build the rest, become super-user and type:
# 	make install

# There are also some test programs in the test subdirectory.  You can
# run them all by typing
#    make test
# Of course, you can just use this as the first make command.

# Note that most of these use the ../dbg/libdbg.a library, which must be
# present or not much will link. Make sure that you have the dbg package
# compiled ...

# There are some programs here  that  the  "make  all"  entry  doesn't
# build.    They   are   typically   the   ones  that  are  hopelessly
# system-dependent.  You might look around after the make  works,  and
# see what odds and ends are of interest.