Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!hpuamsa!frank From: frank@hpuamsa.UUCP (Frank Slootweg CRC) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: Unshar for MS-DOS Message-ID: <7620004@hpuamsa.UUCP> Date: 19 Dec 89 14:42:48 GMT References: <2996@plains.UUCP> Organization: HP NL Lines: 106 > / 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 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