Shar

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
m
Line 4: Line 4:
 
|extensions={{ext|shar}}
 
|extensions={{ext|shar}}
 
}}
 
}}
'''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 file which may be executed directly from the command line in order to re-create the files that were archived.
+
'''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.
 
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.

Revision as of 03:01, 24 December 2013

File Format
Name Shar
Ontology
Extension(s) .shar

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

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 (sh), and standard Unix utilities (particularly sed).
  • GNU sharutils
  • ppt/unshar: A perl script that tries to safely extract from shar files
  • SharUtils for Windows

Sample files

References

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox