[comp.binaries.ibm.pc.d] SHAR files

jbjones@marlin.NOSC.MIL (John B. Jones) (02/23/89)

I've learned metric tons from watching everybody talk to each other on
this news group.  Thanks to all.
In conversation from time to time, I've seen the expression "SHAR file",
and also phrases like "I unshared it" and "most of the archive consisted
of shar files".
Pray tell, what is a SHAR file?
How do you find one?
How do you unshar one?
I couldn't find a man page on this. I'll be grateful for attention.

johnbjones

silver@eniac.seas.upenn.edu (Andy Silverman) (02/23/89)

In article <1131@marlin.NOSC.MIL> jbjones@marlin.nosc.mil.UUCP (John B. Jones) writes:
>
>I've learned metric tons from watching everybody talk to each other on
>this news group.  Thanks to all.
>In conversation from time to time, I've seen the expression "SHAR file",
>and also phrases like "I unshared it" and "most of the archive consisted
>of shar files".
>Pray tell, what is a SHAR file?
>How do you find one?
>How do you unshar one?
>I couldn't find a man page on this. I'll be grateful for attention.
A SHAR file is a sh archive.  sh is the Bourne Shell, which is a UNIX
shell.  SHAR archives are often found in the UNIX sections of databases
like Simtel-20.  What it really is is a self-extracting batch file.  When
you type "sh filename" in UNIX, it reads the shar file which unextracts
itself into component files.  Sort of like an uncompressed .ARC file.
As far as I know they are limited to the UNIX world.



Andy Silverman
Internet: silver@eniac.seas.upenn.edu
CompuServe: 72261,531

soley@ontenv.UUCP (Norman S. Soley) (02/24/89)

In article <1131@marlin.NOSC.MIL>, jbjones@marlin.NOSC.MIL (John B. Jones) writes:
> 
> In conversation from time to time, I've seen the expression "SHAR file",
> and also phrases like "I unshared it" and "most of the archive consisted
> of shar files".
> Pray tell, what is a SHAR file?

Shar stands for SHell ARchive, what it refers to is a program that 
combines multiple ascii files in to a single ascii file with the
necessary control information to extract them again. The neat thing
about them is that no special program is needed to do the unpacking,
the file itself is a UNIX shell script and you just run it. 

> How do you find one?

Look in comp.sources.misc or comp.sources.unix, virtually everything
there is a shar file.

> How do you unshar one?

On a UNIX system you first edit the file and take off the header
information, then you type 'sh sharfile' and away it goes. This is 
potentially dangerous from a security point of view so
programs have been written to unshar files in a more secure manner,
DOS of course doesn't have the bourne shell (unless you have the MKS
toolkit or something like it) so you have to use one of these programs
to process shar files on a PC.


-- 
Norman Soley - Data Communications Analyst - Ontario Ministry of the Environment
UUCP:	uunet!mnetor!ontmoh!ontenv!soley	| Contents of this message are
OR:     soley@ontenv.UUCP 			| my ideas, not the Ministry's
   "Stay smart, go cool, be happy, it's the only way to get what you want"

hartung@amos.ling.ucsd.edu (Jeff Hartung) (02/26/89)

In article <430@ontenv.UUCP> soley@ontenv.UUCP (Norman S. Soley) writes:
> [Lotsa stuff deleted]
>DOS of course doesn't have the bourne shell (unless you have the MKS
>toolkit or something like it) [...]

Has anyone actually used the MKS Toolkit's Korn "sh" to unpack shar files?  I
have it available where I work, but have never tried it due to the amount of
time it takes to transfer large files at 1200 baud, perhaps for nothing. :-)

 --Jeff Hartung--  	
 Disclaimer: My opinions only, etc., etc., BLAH! BLAH! BLAH!...
 Internet - hartung@amos.ling.ucsd.edu          
 UUCP - ucsd!amos.ucsd.edu!hartung

tgoodman@bbn.com (Todd Goodman) (02/28/89)

In article <6000@sdcsvax.UCSD.Edu> hartung@amos.ling.ucsd.edu (Jeff Hartung) writes:
>In article <430@ontenv.UUCP> soley@ontenv.UUCP (Norman S. Soley) writes:
>> [Lotsa stuff deleted]
>>DOS of course doesn't have the bourne shell (unless you have the MKS
>>toolkit or something like it) [...]
>
>Has anyone actually used the MKS Toolkit's Korn "sh" to unpack shar files?
>
> --Jeff Hartung--  	
> Disclaimer: My opinions only, etc., etc., BLAH! BLAH! BLAH!...
> Internet - hartung@amos.ling.ucsd.edu          
> UUCP - ucsd!amos.ucsd.edu!hartung

I use the MKS shell to unpack shar files.  The only difficulties (I can't even
call them problems) I've encountered are:

	1.)  Any "PATH" lines need to be removed since the shell doesn't grok
		':'s in it (due to DOSs use of ':' with drive designators).

	2.)  Some shars wrap some 'if' statements with options that the MKS
		shell doesn't grok.  This isn't a problem since it continues
		to unshar anyway (although you could write over any existing
		files with the same name, since that's where the 'if's usually
		are).

I strongly recommend the MKS Toolkit to anyone interested in gaining the
functionality of UNIX in a DOS environment.  It works great.

My only peeve is the size of the shell.  Any plans to use EMS MKS?

				Todd Goodman
				tgoodman@bbn.com

Disclaimer: I don't work for MKS, nor have I ever worked for MKS.  I'm just a
	satisfied customer who thinks that MKS supplies a great product for a
	great price.