Copyright © 2013,2014 by Thomas E. Dickey
The sharutils program is interesting to me in more than one way:
Shell archives were used for distributing sets of source-files or patches via email or newsgroup postings. As such, this meant that they were used on Unix systems; other uses were minor niches. As of 2013, I still provide patches for some of the programs I work on, e.g., lynx, ncurses, vile, xterm. But for distributing sets of files, there are better ways.
I came into this story late, so some of this is necessarily secondhand. According to the sharutils documentation, it was based on work done in several steps:
shar 3.49to make
shar 4.xin 1994 (and changed licensing to GPL).
The documentation also mentions
uudecode and work done on those by Ian Lance Taylor
and Ulrich Drepper.
Some additional background is needed:
Looking for clues, I see this
link which tells me that James Gosling thinks he wrote
shar in 1978 or 1979. It shows a very simple
# shar -- Shell archiver
for i do
echo a - $i
echo "echo x - $i" >>$AR
echo "cat >$i <<'!Funky!Stuff!'" >>$AR
cat $i >>$AR
echo "!Funky!Stuff!" >>$AR
The script constructs here-documents which rely on
the embedded files not containing special characters (such as
newline) or the magic string
Subsequent implementations by others addressed these limitations,
e.g., using sed-scripts to apply a "X" prefix to each line of the
file, or uuencoding the file.
Gosling, incidentally, is well-known for Emacs and Java.
William Davidsen was active in Usenet (among other things, a
moderator for the Intel 80366 topics) during the late 1980s
until the early 1990s.
Like me, Davidsen was a beta tester for mawk 1.2, and is mentioned in the credits
for tin. Davidsen posted
xshar to comp.sources.misc in
May, 1988 (volume 3). It was not the first shar program posted;
Brandon S. Allbery posted
mkshar in January 1988 (volume 2). Shortly after
shar2, Gail Zacharias posted
There were two more postings of shar-related programs to comp.sources.misc in 1989 (unshar.prl and unshar.umc—a MicroEmacs macro).
Oddly, Davidsen used
shar 1.27 when posting
ddf to comp.sources.misc in 1990. (Without studying
the shell archives, it is hard to see which program generated
them; most early versions of
shar did not print a
version number, e.g., this example from
Warren Tucker posted his changes to alt.sources:
shar 3.10, in turn derived from
Richard H. Gumpertz continued, releasing shar 3.49 in August 1990 (see for example this posting using 3.49). The "3.49" appears to be the RCS version of one or more parts of the program, as seen in this old change-log. Some changes were made after "3.49", though.
What about cshar? It was distributed via
comp.sources.unix, as indicated
here. The note comments that
shar 3.49 works
with uuencode/uudecode, while
makekit handles splitting and kit-building.
There appears to have been more than one
csharwith 3 patches through 1988/06/06. This is a program written in C, rather than a
/bin/shshell script. You can still find copies of the archive as
cshar.tar.Z(this for example), but it is used infrequently. This archive is useful for browsing.
csharwhich can generate scripts for
/bin/sh. Interestingly enough, a few people used it, e.g., this (1996) and this (1998).
comp.sources.unix died in 1996 or 1997 and after almost ten years was removed. Incidentally, one of the last programs to be posted on it was Cdk 4.7.0, in May 1996 (I maintain Cdk). Likewise, my program conflict was one of the last. to be posted on comp.sources.misc, in April 1995.
While I had access to Usenet from the late 1980s on, and obtained several programs by unshar'ing them from newsgroup postings I did not become interested in creating my own shar files until I left the Software Productivity Consortium early in 1994. From late 1992, I had switched direction, making improvements to programs started by others, rather than developing entirely new programs as I had done to support the older projects from the 1980s and before. In my newer projects, I wanted to continue developing programs such as vile and use those which I had written by myself (in particular, ded) while avoiding conflict-of-interest issues. The way to do this, I decided, was to ensure that my external projects were clearly visible.
Maintaining an ftp site did not meet that need; it was not visible enough. Nor did uploading to a common ftp site appear to be an improvement. I decided that the source-newsgroups which were archived on ftp sites would be a good solution.
Though I had contributed fixes for a few programs which were distributed as shar-files (see this discussion), I had not done this for my own programs. I discussed this with Paul Fox (original developer of vile) in July 1994 (shortly after I submitted diffstat to comp.sources.unix).
Around the same time, I sent a fix for the shar 3.52 beta:
I've a patch which makes the 'touch' option work properly on machines that haven't got a 'touch' command that recognizes the timestamp option (e.g., SunOS 4.1.x).
The patch provided C code for a replacement program. François Pinard replied with a further refinement, and thereafter I was on the mailing list for the succession of beta versions. This also led me into involvement with autoconf betas before its 2.0 release.
As one may see from the change-log, my involvement was at the beginning, up until it was renamed to sharutils and released as 4.1, etc. After that, I was busy with other projects. My last mail from the sharutils mailing list was in December 1996.
In short, I am one of about 60 people who have contributed to sharutils:
Oddly (despite its lessened usage), sharutils has grown (counting bundled libraries) more than ten times larger than the release which I worked on. The table shows C SLOCs (using c_count) and the size of the unpacked source tar-file:
These programs are rarely used now. Some do not use sharutils (arguably the most complete implementation).
For instance this 2006 FreeBSD review uses an old version of shar (a shell script), as one can see by examining the script from the base system (e.g., release 10). Oddly, the script is not much more than an improved version of the script attributed to James Gosling. It does not use uuencoding (for handling non-text files), although the technique is said to be very old, e.g., from 4.0BSD:
(both written by Mark Horton in 1980, and posted to mod.sources).