Shar
Dan Tobias (Talk | contribs) (Created page with "{{FormatInfo |formattype=electronic |subcat=Archiving |extensions={{ext|shar}} }} '''shar''' is a self-extracting archive format for Unix-type systems. It encodes a group of ...") |
Dexvertbot (Talk | contribs) m (Change telparia.com samples link to template) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{FormatInfo | {{FormatInfo | ||
+ | |name=shar | ||
|formattype=electronic | |formattype=electronic | ||
|subcat=Archiving | |subcat=Archiving | ||
− | |extensions={{ext|shar}} | + | |extensions={{ext|shar}}, {{ext|sha}} |
+ | |pronom={{PRONOM|fmt/329}} | ||
}} | }} | ||
+ | '''shar''' is a self-extracting archive format for Unix-type systems. It encodes a group of files in a text-based format embedded in a [[Bourne shell script|shell script]] which may be executed directly from the command line in order to re-create the files that were archived. | ||
− | ''' | + | There are many variant forms of shar archives, and there is no simple algorithm to extract files from all of them. Theoretically, it could require the full power of a Unix shell program, and the availability of every common Unix utility program. |
+ | |||
+ | '''Security warning''': The usual ways of extracting from shar archives involve executing arbitrary code contained in the shar file. | ||
+ | |||
+ | == Examples == | ||
+ | To extract the files in a shar archive: | ||
+ | $ sh example.shar | ||
+ | |||
+ | Another way to extract files. This also handles shar files that begin with email headers or other extraneous data. | ||
+ | $ unshar example.shar | ||
+ | |||
+ | == Software == | ||
+ | * shar files can be executed using a Unix Bourne-compatible shell (<code>sh</code>), and standard Unix utilities (particularly <code>sed</code>). | ||
+ | * [http://www.gnu.org/software/sharutils/ GNU sharutils] | ||
+ | * [http://search.cpan.org/~cwest/ppt-0.14/bin/unshar ppt/unshar]: A perl script that tries to safely extract from shar files | ||
+ | * [http://gnuwin32.sourceforge.net/packages/sharutils.htm SharUtils for Windows] | ||
+ | |||
+ | == Sample files == | ||
+ | * http://ftp.gnu.org/gnu/tar/ → *.shar* | ||
+ | * http://cd.textfiles.com/carousel344/MACTOSH/UNIX/ → *.SHA | ||
+ | * {{DexvertSamples|archive/shar}} | ||
== References == | == References == | ||
* [[Wikipedia:shar|Wikipedia article]] | * [[Wikipedia:shar|Wikipedia article]] | ||
− | * [http://linux.die.net/man/1/shar | + | * Linux man pages: [http://linux.die.net/man/1/shar shar], [http://linux.die.net/man/1/unshar unshar] |
Latest revision as of 02:55, 28 December 2023
shar is a self-extracting archive format for Unix-type systems. It encodes a group of files in a text-based format embedded in a shell script which may be executed directly from the command line in order to re-create the files that were archived.
There are many variant forms of shar archives, and there is no simple algorithm to extract files from all of them. Theoretically, it could require the full power of a Unix shell program, and the availability of every common Unix utility program.
Security warning: The usual ways of extracting from shar archives involve executing arbitrary code contained in the shar file.
Contents |
[edit] Examples
To extract the files in a shar archive:
$ sh example.shar
Another way to extract files. This also handles shar files that begin with email headers or other extraneous data.
$ unshar example.shar
[edit] Software
- shar files can be executed using a Unix Bourne-compatible shell (
sh
), and standard Unix utilities (particularlysed
). - GNU sharutils
- ppt/unshar: A perl script that tries to safely extract from shar files
- SharUtils for Windows
[edit] Sample files
- http://ftp.gnu.org/gnu/tar/ → *.shar*
- http://cd.textfiles.com/carousel344/MACTOSH/UNIX/ → *.SHA
- dexvert samples — archive/shar
[edit] References
- Wikipedia article
- Linux man pages: shar, unshar