[comp.binaries.ibm.pc.d] Unshar for MS-DOS

person@plains.UUCP (Brett G. Person) (12/15/89)

This may be a silly question, but is there a program out there that will
handle a shar file under MS-DOS?
thanks
-- 
Brett G. Person
North Dakota State University
uunet!ndsuvax!ncperson | ncperson@ndsuvax.bitnet | ncperson@plains.nodak.edu

w8sdz@smoke.BRL.MIL (Keith Petersen) (12/15/89)

[ncperson@plains.nodak.edu asks about Unshar for MS-DOS.]

Please check out pd1:<msdos.filutl>SHAREXE.ARC on SIMTEL20.

Keith
-- 
Keith Petersen
Maintainer of SIMTEL20's CP/M, MSDOS, & MISC archives [IP address 26.2.0.74]
Internet: w8sdz@WSMR-SIMTEL20.Army.Mil, w8sdz@brl.arpa  BITNET: w8sdz@NDSUVM1
Uucp: {ames,decwrl,harvard,rutgers,ucbvax,uunet}!wsmr-simtel20.army.mil!w8sdz

frank@hpuamsa.UUCP (Frank Slootweg CRC) (12/15/89)

> This may be a silly question, but is there a program out there that will
> handle a shar file under MS-DOS?

  No silly questions, only silly answers. Here comes one :-) :

  The MKS toolkit from Mortice Kern Systems (sp?) gives you a Korn shell
"vi" and many other UNIX commands. With them you can process shar's
(with some difficulty because of minor differences in "wc", "touch",
"chmod" between the MKS toolkit and "real" UNIX).
  Since the MKS toolkit also contains a fine "cpio" you probably will
want to use "cpio" archives instead of shar's.

Frank "Happy MKS user" Slootweg, Hewlett-Packard, The Netherlands.

dhw@itivax.iti.org (David H. West) (12/19/89)

In article <7620003@hpuamsa.UUCP> frank@hpuamsa.UUCP (Frank Slootweg CRC) writes:
>  The MKS toolkit from Mortice Kern Systems (sp?) gives you a Korn shell
>"vi" and many other UNIX commands. With them you can process shar's
>(with some difficulty because of minor differences in "wc", "touch",
>"chmod" between the MKS toolkit and "real" UNIX).

[Frank, my newsreader doesn't display your return address in a form my
mailer can handle; you might want to include an explicit path from
the internet in your postings.]

If you have fixes for the difficulties, please consider posting
them.  

-David West      dhw@iti.org

frank@hpuamsa.UUCP (Frank Slootweg CRC) (12/19/89)

> / hpuamsa:comp.binaries.ibm.pc.d / dhw@itivax.iti.org (David H. West) /  7:04 pm  Dec 18, 1989 /
> In article <7620003@hpuamsa.UUCP> frank@hpuamsa.UUCP (Frank Slootweg CRC) writes:
> >  The MKS toolkit from Mortice Kern Systems (sp?) gives you a Korn shell
> >"vi" and many other UNIX commands. With them you can process shar's
> >(with some difficulty because of minor differences in "wc", "touch",
> >"chmod" between the MKS toolkit and "real" UNIX).
> 
> [Frank, my newsreader doesn't display your return address in a form my
> mailer can handle; you might want to include an explicit path from
> the internet in your postings.]
> 
> If you have fixes for the difficulties, please consider posting
> them.  
> 
> -David West      dhw@iti.org
> ----------

(Since this took quite some time to recollect and type, I will post for
 the benefit of the net (and MKS? :-)) instead of sending mail to
 David).

David,

  I do not have real fixes. I have however found my original notes. My
original posting was not completely correct. There is no problem with
"wc" but with "sum -r".

  Note: My experience is based on transporting shars made by *our*
(Hewlett-Packard HP-UX) version of "shar(1)" to the MKS Toolkit
environment on a PC. Sadly enough there is no such thing as *the*
"shar(1)" :-)

Details :
=========

- ".ksh" extension :
  If you want to execute the shar directly its extension should be ".ksh".

- "/dev/null" versus "/dev/null" :
  Our shars optionally contain a "sum -r" check per file. If they do
  then there is a construct like :

  if sum -r </dev/null >/dev/null 2>&1
  then
	sumopt='-r'
  else
	sumopt=''
  fi

  to determine whether BSD or SYSV "sum" is available on the target system.
  MKS knows only about "/dev/nul" (one "l").

- "chmod" differences :
  Our shars optionally preserve the user and group ownership of the
  archived files and directories. If they do then there is a construct
  like :

  chmod 644 /etc/motd

  The MKS "chmod" only understands "+w" etc (i.e. no octal mode).

- "sum -r": Difference in counting characters :
  Our shars optionally contain a "sum -r" check per file.
  When a UNIX "shar" is uploaded to a PC most upload programs will
  insert a CR before the LF at the end of each line. They need to do
  this otherwise the resulting file is not a valid MS-DOS text file and
  hence not a valid script for the MKS Korn Shell. However the character
  count *in* the archive is not adjusted accordingly so the unshar will
  "fail" on a "sum -r" check.
  Workarounds :
  - Remove the "sum -r" check from the shar.
  - Change the way "sum -r" reads the file :
    Our shars have constructs like :

    set `sum $sumopt </etc/motd`; if test $1 -ne 47574
    then
	echo ERROR: /etc/motd checksum is $1 should be 47574
    fi

    Change this to :

    set `tr -d "\015" </etc/motd | sum $sumopt`; if test $1 -ne 47574

    Obviously this is only valid for text files (i.e. not binaries), but
    this is the most common case going from UNIX to PC. (UU)encoded
    binaries are fine because they are text files for both UNIX and PC.
- "touch(1)" differences :
  Our shars optionally preserve the time stamps of the archived files.
  If they do then there is a construct like :

  touch -m 1023160389 /etc/motd
  touch -a 1219150089 /etc/motd

  "Real UNIX" (at least System V) has the following syntax for
  "touch(1)" :

  touch [-amc] [mmddhhmm[yy] files

  The MKS "touch" uses :

  touch .... [yymmddhhmm.ss]

Summary: *I* prefer to use UNIX/MKS "cpio" and I *do* like the MKS
         Toolkit (even with the above mentioned differences).

Frank Slootweg, Hewlett-Packard, Dutch Customer Response Center.

dennis@virtech.uucp (Dennis P. Bednar) (12/22/89)

In article <7620003@hpuamsa.UUCP>, frank@hpuamsa.UUCP (Frank Slootweg CRC) writes:
> > This may be a silly question, but is there a program out there that will
> > handle a shar file under MS-DOS?
> 

I am not positive, but I saw an unshar.c posted to the minix
newsgroup.  It appeared that it attempts to unshar a file
that was shared by 'cat', or sed, but I didn't have time to
check into it.
-- 
Dennis Bednar	uunet!virtech!dennis	(703)430-9247(w)   (703)437-4384(h)
Virtual Technologies Inc, P.O. Box 876, Sterling VA, 22170

gerry@tvcent.uucp (Gerry Singleton) (12/28/89)

In article <7620004@hpuamsa.UUCP> frank@hpuamsa.UUCP (Frank Slootweg CRC) writes:
<> / hpuamsa:comp.binaries.ibm.pc.d / dhw@itivax.iti.org (David H. West) /  7:04 pm  Dec 18, 1989 /
<> In article <7620003@hpuamsa.UUCP> frank@hpuamsa.UUCP (Frank Slootweg CRC) writes:
<> >  The MKS toolkit from Mortice Kern Systems (sp?) gives you a Korn shell
<> >"vi" and many other UNIX commands. With them you can process shar's
<> >(with some difficulty because of minor differences in "wc", "touch",
<> >"chmod" between the MKS toolkit and "real" UNIX).
<> 
<> [Frank, my newsreader doesn't display your return address in a form my
	[deleted]
<> 
<> -David West      dhw@iti.org
<> ----------
<
<(Since this took quite some time to recollect and type, I will post for
< the benefit of the net (and MKS? :-)) instead of sending mail to
< David).
<
<David,
<
<  I do not have real fixes. I have however found my original notes. My
<original posting was not completely correct. There is no problem with
	[deleted]
<
<Frank Slootweg, Hewlett-Packard, Dutch Customer Response Center.

Hi all you unsharers out there,

Messy-Dos users should be aware of Rick Salz' cshar.  As far back as version
1.0 of this program, Rick included sufficient code to produce an sh (called
shell) capable to sharing and unsharing standard archives.  I understand 
that there is a new version available with enhanced capabilities from
archiving sites ( Rats! I missed the posting.).  This fine program works
well under UNIX and under MessyDos, when compiled for that environment.

One caveat, I can't remember whether I had to come up with my own "wc"", "sum",
or "chmod" clones but I think not.  Do have a look, I've been using this
package since April '87, hence the foggy recollections.  Compilation
was under MSC 4.0.  I assume moving it to MSC 5.x and TurboC will be no
big deal.

You can usually find Rick's postings in comp.sources.unix so that's the
place to search in the archives.

Good Luck,
ger
--
G. Roderick Singleton, System Administrator
{ lethe | suncan | geac | jtsv16 | tvcent }!eclectic!gerry
"ALL animals are created equal, BUT some animals are MORE equal than others."
George Orwell
-- 
--
G. Roderick Singleton, System Administrator
{ lethe | suncan | geac | jtsv16 | tvcent }!eclectic!gerry
"ALL animals are created equal, BUT some animals are MORE equal than others."