What is a shar file? [closed] What is a shar file? [closed] shell shell

What is a shar file? [closed]


It's a shell archive, a self extracting executable shell script which is meant to be a convenient way to ship archives of files and have them appear simply by running the script.

An example is shown in the transcript below which gives only one file from the archive, output.txt:

pax> cat shar.bash #!/bin/bashtr '[A-Za-z]' '[N-ZA-Mn-za-m]' >output.txt <<EOF    Uryyb sebz Cnk.EOFpax> ./shar.bash pax> cat output.txt     Hello from Pax.

That's a fairly simplistic one since it only delivers one file, and it doesn't compress it at all, but it should give you the general idea.

A real one would probably give you something like a set of files combined with tar, gzip and uuencode, which would then be passed through uudecode, gunzip and tar to deliver the original content.


A self-extracting archive: a shell script that extracts some data contained in it.

Wikipedia has more: http://en.wikipedia.org/wiki/Shar


It's a kind of self-extracting archive.

It's a bit dangerous (like a self-extracting .exe on Windows), because it runs itself to extract itself, so it could potentially do all kinds of other things that you did not expect.

I think this is what Oracle uses to distribute the JVM on Linux (to make you click through a license agreement first).

Normally, people would just use tar archives (which cannot execute arbitrary code, but also not show any dialogs).