[comp.binaries.ibm.pc.d] Using the MKS Toolkit on SHARchives

andy@mks.com (Andy Toy) (12/23/89)

In article <7620004@hpuamsa.UUCP> frank@hpuamsa.UUCP (Frank Slootweg CRC) writes:
>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)" :-)

:-(

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

Mostly true, but you can actually use ``filename.'', ``sh filename.''
[note the dot] or ``sh < filename'' [without the dot] to execute a shell
script without an extension.

>- "/dev/null" versus "/dev/null" [ed. /dev/nul]:
>  [sum -r example deleted]
>  MKS knows only about "/dev/nul" (one "l").

DOS does not have /dev/{null,lp,tty}, et cetera.  You can only use DOS
device names so you will have to change those device names to valid
DOS device names such as nul, prn, con, et cetera.  Maybe you use
something like this:

	OS=`uname -s`
	if [ OS = "unix" ]
	then NULL=/dev/null
	else NULL=nul
	fi
	cmd blah > $NULL

or change all the "/dev/null" to "nul" in the shar:

	sed 's/\/dev\/null/nul/' sharfile > sharfile.new

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

The chmod from the MKS Toolkit version 3.1 does accept octal modes.
Just remember that r, x, s and t permissions are not applicable or
they have different meaning on DOS.  Also the user, group and
other permissions are not applicable.

>- "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.

Sum -r should be working correctly, but you are correct about
the \n to \r\n conversion on text files causing problems.  
Unfortunately UNIX and DOS text file formats differ.

>- "touch(1)" differences :
>  Our shars optionally preserve the time stamps of the archived files.
>  "Real UNIX" (at least System V) has the following syntax for
>  "touch(1)" :
>  touch [-amc] [mmddhhmm[yy] files [ed. missing `]']
>  The MKS "touch" uses :
>  touch .... [yymmddhhmm.ss]

Note that using touch in this way makes these shars not portable to BSD UNIX.

BSD4.3 : touch [-cf] files
SVR3: touch [-acm] [MMDDhhmm[YY]] files 
MKS: touch ... [[YY[MM[DD]]]hhmm[.SS]] files

This is different from System V and we will be changing it in a future
release.  The question is `what will we change it to?' because SV claims
that it will be POSIX conformant and draft 9 POSIX.2 defines touch as:

POSIX: touch [-acm] [-r ref_file | -t [[CC]YY]MMDDhhmm[.SS]] file...

Our format is almost the same as the POSIX.2 definition except for the
century part of the year.  Our -f option is the same as the -r option
and our time format is specified without using -t.  However we will
make it compatible with the touch from System V Release 4.
-- 
Andy Toy, Mortice Kern Systems Inc.,       Internet: andy@mks.com
  35 King Street North, Waterloo,       UUCP: uunet!watmath!mks!andy
      Ontario, CANADA N2J 2W9      Phone: 519/884-2251  FAX: 519/884-8861