Introduction
A shell archive, or sharchive, is an archive that is itself a shell script: running it
with sh recreates the packaged files. James Gosling is credited with the
first shar utility, in 1982. The format was widely used to pass software
around Usenet and is now considered legacy.
Extracting a shell archive by running it executes whatever the script contains, so one from an unknown source is a risk.
Structure
For each file the script has commands that report its name and create it from a here document, closed by a unique terminator line. The contents are plain text, so binary files need to be encoded first.
Not described
This page is a first outline.
Known, not yet covered
- Reference: the commands that each variant of the tool writes.
- Viewer: the site has no viewer for this format.
Links
Software
- GNU sharutils – the current GNU version of shar (Unix)
- UnxUtils – collection that includes GNU shar (Windows)
Reference
- Shar – Wikipedia’s account of the format and its variants