Linux Classes
Share This With a Friend  
LINUX CLASSES - COMPRESSION, ENCODING AND ENCRYPTION

What is a Shell Archive?

Shell Archives

A shell archive is like a tar file, but it is used only for packaging source code and other plain-text files. It provides a convenient way to smash together all the source files for a project into one file that can be distributed by email. (The original files are not deleted.) Shell archives (commonly called shar--for shell archive--files) get their name from the fact that they contain the Linux commands needed to extract the original files.

By convention, shell archives are named with a .shar extension. To create a shar file, use a command like this:

shar input_files > shar_file

So, to create a panda.shar file containing all the files from the panda/source directory, you'd issue a command like this (note the use of the asterisk as a wildcard):

shar panda/source/* > panda.shar

If you look inside a shar file, you'll see the original files sandwiched between the commands to extract them. But you don't have to execute those commands directly to unpack a shar file. Just enter this command to extract the files to the current directory:

sh panda.shar

The sh command will run the Linux commands embedded in the panda.shar file and re-create all the original files.

You might be wondering why you'd want to use shar files when tar files seem to serve the same purpose. The answer is that shar files are ready to send (because they're plain text), whereas a tar file must be encoded first. See the next section for more on encoding and decoding.

[ RETURN TO INDEX ]


   

Comments - most recent first
(Please feel free to answer questions posted by others!)

business finance software     (10 Aug 2010, 13:45)
Thanks for posting! I really enjoyed the report. I've already bookmark

this article.
registry cleaner reviews     (05 Aug 2010, 10:53)
wow.. i'm very

enjoy reading your post. great.

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 
 


Ask Bob Rankin - Free Tech Support


Copyright © by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.