home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-05-06 | 39.1 KB | 1,098 lines |
-
- #!/bin/sh
- # this is part 7 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file Patch1.6 continued
- #
- CurArch=7
- if test ! -r s2_seq_.tmp
- then echo "Please unpack part 1 first!"
- exit 1; fi
- ( read Scheck
- if test "$Scheck" != $CurArch
- then echo "Please unpack part $Scheck next!"
- exit 1;
- else exit 0; fi
- ) < s2_seq_.tmp || exit 1
- echo "x - Continuing file Patch1.6"
- sed 's/^X//' << 'SHAR_EOF' >> Patch1.6
- X
- X***************
- X*** 13,21 ****
- X 2. The sources (or parts thereof) or objects generated from the
- X sources (or parts of sources) cannot be sold under any circumstances.
- X
- X! $Header: readme 1.3 90/02/16 16:58:10 MS_user Exp $
- X
- X $Log: readme $
- X Revision 1.3 90/02/16 16:58:10 MS_user
- X Set up 1.5 release
- X
- X--- 13,33 ----
- X 2. The sources (or parts thereof) or objects generated from the
- X sources (or parts of sources) cannot be sold under any circumstances.
- X
- X! $Header: readme 1.7 90/04/03 18:07:01 MS_user Exp $
- X
- X $Log: readme $
- X+ Revision 1.7 90/04/03 18:07:01 MS_user
- X+ Some changes for 1.6 (Int 24 and Config file)
- X+
- X+ Revision 1.6 90/03/14 12:37:23 MS_user
- X+ Add some more 1.6 changes
- X+
- X+ Revision 1.5 90/03/06 17:01:00 MS_user
- X+ 1.6 release
- X+
- X+ Revision 1.4 90/02/22 16:52:41 MS_user
- X+ Add XMS support
- X+
- X Revision 1.3 90/02/16 16:58:10 MS_user
- X Set up 1.5 release
- X
- X***************
- X*** 59,69 ****
- X child process is executing.
- X
- X Note: Swapping to Extended memory is probably the most dangerous
- X! because there is no memory manager available for it.
- X
- X 2) History processing has been added.
- X
- X! 3) Command line editing has been added.
- X
- X 4) The command line prompt can be programmed to display 'useful'
- X information.
- X--- 71,85 ----
- X child process is executing.
- X
- X Note: Swapping to Extended memory is probably the most dangerous
- X! unless you have an XMS memory manager available. The shell
- X! requires the XMS manager to support the version 2 XMS
- X! specification.
- X
- X 2) History processing has been added.
- X
- X! 3) Command line editing has been added. A configuration file (sh.ini)
- X! allows the Command Line editing keys to be tailored to the users
- X! requirements
- X
- X 4) The command line prompt can be programmed to display 'useful'
- X information.
- X***************
- X*** 83,92 ****
- X 7) Wild cards on drives (ie echo *:*.c will echo all the C files in
- X the current directories of each drive) are supported.
- X
- X! 8) Interrupt 24 processing has been added.
- X
- X! The shell was built using MS-DOS C and MASM v5.1 in large model mode.
- X
- X In order to rebuild this program, you need the DIRECTORY(3) functions
- X for MSDOS (also included) and the version of open in your library must
- X pass the O_NOINHERIT bit on the MSDOS kernel. The Microsoft C V5.1
- X--- 99,115 ----
- X 7) Wild cards on drives (ie echo *:*.c will echo all the C files in
- X the current directories of each drive) are supported.
- X
- X! 8) Full Interrupt 24 processing has been added.
- X
- X! 9) Filename completion has been added.
- X
- X+ 10) Alternate command interpreters are supported in shell scripts a la
- X+ Unix V.4.
- X+
- X+ 11) A configuration file is supported to allow edit key specification.
- X+
- X+ The shell was built using MS-DOS C and MASM v5.1 in large model mode.
- X+
- X In order to rebuild this program, you need the DIRECTORY(3) functions
- X for MSDOS (also included) and the version of open in your library must
- X pass the O_NOINHERIT bit on the MSDOS kernel. The Microsoft C V5.1
- X***************
- X*** 94,100 ****
- X fixed this using CodeView to find where the library function masks off
- X the bottom 2 bits. Extracted the object from the library and patched
- X mask from 0x03 to 0x83 in the object and reload into the library. No
- X! Problem.
- X
- X You can do want you like with this software as long as you don't sell
- X it or remove the Copyright notices in the sources or object.
- X--- 117,123 ----
- X fixed this using CodeView to find where the library function masks off
- X the bottom 2 bits. Extracted the object from the library and patched
- X mask from 0x03 to 0x83 in the object and reload into the library. No
- X! Problem. The Patch.Lib document describes the process in more detail.
- X
- X You can do want you like with this software as long as you don't sell
- X it or remove the Copyright notices in the sources or object.
- XIndex: sh.1
- XPrereq: 1.2
- X*** ../sh15/sh.1 Wed Mar 7 11:09:03 1990
- X--- sh.1 Tue May 1 20:02:16 1990
- X***************
- X*** 1,3 ****
- X--- 1,4 ----
- X+ .\"!ts -t -msqan
- X .\"
- X .\" MS-DOS SHELL - Manual Page
- X .\"
- X***************
- X*** 13,21 ****
- X .\" 2. The sources (or parts thereof) or objects generated from the sources
- X .\" (or parts of sources) cannot be sold under any circumstances.
- X .\"
- X! .\" $Header: sh.1 1.2 90/02/16 16:58:27 MS_user Exp $
- X .\"
- X .\" $Log: sh.1 $
- X .\" Revision 1.2 90/02/16 16:58:27 MS_user
- X .\" Set up 1.5 release
- X .\"
- X--- 14,46 ----
- X .\" 2. The sources (or parts thereof) or objects generated from the sources
- X .\" (or parts of sources) cannot be sold under any circumstances.
- X .\"
- X! .\" $Header: sh.1 1.10 90/05/01 19:58:38 MS_user Exp $
- X .\"
- X .\" $Log: sh.1 $
- X+ .\" Revision 1.10 90/05/01 19:58:38 MS_user
- X+ .\" Fix typing error
- X+ .\"
- X+ .\" Revision 1.9 90/04/04 11:31:14 MS_user
- X+ .\" Change MAILPATH to use a semi-colon and not a colon for DOS
- X+ .\"
- X+ .\" Revision 1.8 90/03/28 19:42:29 MS_user
- X+ .\" Full Interrupt 24 handler included
- X+ .\"
- X+ .\" Revision 1.7 90/03/14 19:43:46 MS_user
- X+ .\" Add new initialisation file processing
- X+ .\"
- X+ .\" Revision 1.6 90/03/09 16:04:37 MS_user
- X+ .\" Add SH_BELL and SH_ALT_KEYS description
- X+ .\"
- X+ .\" Revision 1.5 90/03/06 16:03:00 MS_user
- X+ .\" Final clean up for 1.6
- X+ .\"
- X+ .\" Revision 1.4 90/03/05 13:46:27 MS_user
- X+ .\" Add functionality changes for Command Line editor
- X+ .\"
- X+ .\" Revision 1.3 90/02/22 16:55:13 MS_user
- X+ .\" Add XMS driver support
- X+ .\"
- X .\" Revision 1.2 90/02/16 16:58:27 MS_user
- X .\" Set up 1.5 release
- X .\"
- X***************
- X*** 23,38 ****
- X .\" Initial revision
- X .\"
- X .\"
- X! .\"
- X .ds OK [\|
- X .ds CK \|]
- X! .TH SH 1L "Data Logic Limited" "MS-DOS Version 1.5"
- X .SH NAME
- X sh, rsh - shell, the standard/restricted command programming language
- X .SH SYNOPSIS
- X! \fBsh\fR [ \fB-acefhiknmrstuvx\fR ] [ args ]
- X .br
- X! \fBrsh\fR [ \fB-acefhiknmrstuvx\fR ] [ args ]
- X .SH DESCRIPTION
- X \fISh\fR is a command programming language that executes commands read from a
- X terminal or a file. \fIRsh\fR is a restricted version of the standard command
- X--- 48,63 ----
- X .\" Initial revision
- X .\"
- X .\"
- X! .\" This man page requires tbl.
- X .ds OK [\|
- X .ds CK \|]
- X! .TH SH 1L "Data Logic Limited" "MS-DOS Version 1.6"
- X .SH NAME
- X sh, rsh - shell, the standard/restricted command programming language
- X .SH SYNOPSIS
- X! \fBsh\fR [ \fB-acefhiknmrstuvx0\fR ] [ args ]
- X .br
- X! \fBrsh\fR [ \fB-acefhiknmrstuvx0\fR ] [ args ]
- X .SH DESCRIPTION
- X \fISh\fR is a command programming language that executes commands read from a
- X terminal or a file. \fIRsh\fR is a restricted version of the standard command
- X***************
- X*** 114,124 ****
- X which to execute the \fIlist\fR, but does not fork a sub-shell as a Unix
- X system would. The original environment is restored on completion.
- X .TP
- X! \fB{\fIlist\fB;}\fR
- X .br
- X \fIlist\fR is simply executed.
- X .TP
- X! \fIname \fB() {\fIlist\fB;}\fR
- X Define a function which is referenced by \fIname\fR. The body of the function
- X is the \fIlist\fR of commands between \fB{\fR and \fB}\fR. Execution of
- X functions is described below (see \fIExecution\fR).
- X--- 139,149 ----
- X which to execute the \fIlist\fR, but does not fork a sub-shell as a Unix
- X system would. The original environment is restored on completion.
- X .TP
- X! \fB{ \fIlist\fB; }\fR
- X .br
- X \fIlist\fR is simply executed.
- X .TP
- X! \fIname \fB() { \fIlist\fB; }\fR
- X Define a function which is referenced by \fIname\fR. The body of the function
- X is the \fIlist\fR of commands between \fB{\fR and \fB}\fR. Execution of
- X functions is described below (see \fIExecution\fR).
- X***************
- X*** 225,236 ****
- X .TP
- X .B
- X .SM CDPATH
- X! The search path for the \fIcd\fR command. (Note that becuase a colon is used
- X by MSDOS to indicate a drive, a semi-colon is used to separate the path names
- X instead of a colon - this implies that the CDPATH variable must be set using
- X single or double quotes to surround the value).
- X .TP
- X .B
- X .SM EXTENDED_LINE
- X This parameter defines a file containing a list of command which can accept
- X an Extended Command Line using the indirect command file character \fB@\fR.
- X--- 250,268 ----
- X .TP
- X .B
- X .SM CDPATH
- X! The search path for the \fIcd\fR command. (Note that because a colon is used
- X by MSDOS to indicate a drive, a semi-colon is used to separate the path names
- X instead of a colon - this implies that the CDPATH variable must be set using
- X single or double quotes to surround the value).
- X .TP
- X .B
- X+ .SM COMSPEC
- X+ When the shell has to process an MSDOS \fI.bat\fR file, it expects the file
- X+ indicated by the value of this environment variable to be an executable
- X+ program capable of processing the MSDOS \fI.bat\fR file. The program is
- X+ invoked with the arguments \fB/c bat_file_name\fR.
- X+ .TP
- X+ .B
- X .SM EXTENDED_LINE
- X This parameter defines a file containing a list of command which can accept
- X an Extended Command Line using the indirect command file character \fB@\fR.
- X***************
- X*** 273,279 ****
- X .TP
- X .B
- X .SM MAILPATH
- X! A colon (\fB:\fR) separated list of file names. If this parameter is set,
- X the shell informs the user of the arrival of mail in any of the specified
- X files. Each file name can be followed by \fB%\fR and a message that will be
- X printed when the modification time changes. The default message is
- X--- 305,311 ----
- X .TP
- X .B
- X .SM MAILPATH
- X! A semi-colon (\fB;\fR) separated list of file names. If this parameter is set,
- X the shell informs the user of the arrival of mail in any of the specified
- X files. Each file name can be followed by \fB%\fR and a message that will be
- X printed when the modification time changes. The default message is
- X***************
- X*** 285,291 ****
- X change \fB\s-1PATH\s+1\fR if executing under \fIrsh\fR. (Note that because a
- X colon is used by MSDOS to indicate a drive, a semi-colon is used to separate
- X the path names instead of a colon - this implies that the PATH variable must
- X! be set using single or double quotes to surround the value).
- X .TP
- X .B
- X .SM PS1
- X--- 317,327 ----
- X change \fB\s-1PATH\s+1\fR if executing under \fIrsh\fR. (Note that because a
- X colon is used by MSDOS to indicate a drive, a semi-colon is used to separate
- X the path names instead of a colon - this implies that the PATH variable must
- X! be set using single or double quotes to surround the value). The Shell
- X! automatically converts Unix format \fB\s-1PATH\s+1\fR assignments to MSDOS
- X! format when appropriate. A assignment is converted if there are no semi-colons,
- X! no backslashes and one or more colons. If there is only one colon, it must
- X! not be the second character of the new value.
- X .TP
- X .B
- X .SM PS1
- X***************
- X*** 299,314 ****
- X .SM SHELL
- X When the shell is invoked, it scans the environment (see \fIEnvironment\fR
- X below) for this name. If it is found and there is an 'r' in the file name
- X! part of its value, the shell becomes a restricted shell.
- X .TP
- X .B
- X .SM TMP
- X! The location of temporary files created by the shell.
- X .RE
- X .PP
- X The shell gives default values to \fB\s-1PATH\s+1\fR, \fB\s-1PS1\s+1\fR,
- X \fB\s-1PS2\s+1\fR, \fB\s-1SHELL\s+1\fR, \fB\s-1HOME\s+1\fR and
- X \fB\s-1IFS\s+1\fR.
- X .SS Blank Interpretation
- X After parameter and command substitution, the results of substitution are
- X scanned for internal field separator characters (those found in
- X--- 335,356 ----
- X .SM SHELL
- X When the shell is invoked, it scans the environment (see \fIEnvironment\fR
- X below) for this name. If it is found and there is an 'r' in the file name
- X! part of its value, the shell becomes a restricted shell. The shell also
- X! uses this variable to decide which program to spawn to interpret shell
- X! scripts (see \fIExecution\fR below).
- X .TP
- X .B
- X .SM TMP
- X! The location of temporary files created by the shell. If this variable is
- X! not defined, the Shell uses the \fB\s-1HOME\s+1\fR directory for temporary
- X! files. Failing that, the root directory of the current drive is used.
- X .RE
- X .PP
- X+ .sp
- X The shell gives default values to \fB\s-1PATH\s+1\fR, \fB\s-1PS1\s+1\fR,
- X \fB\s-1PS2\s+1\fR, \fB\s-1SHELL\s+1\fR, \fB\s-1HOME\s+1\fR and
- X \fB\s-1IFS\s+1\fR.
- X+ .sp
- X .SS Blank Interpretation
- X After parameter and command substitution, the results of substitution are
- X scanned for internal field separator characters (those found in
- X***************
- X*** 343,348 ****
- X--- 385,396 ----
- X \fB\(ga\(ga!\(aa\(aa\fR any character not enclosed is matched.
- X .PD
- X .RE
- X+ .PP
- X+ If the shell has to open or create the file \fB/dev/tty\fR or \fB/dev/null\fR
- X+ (which are Unix special files), they are converted to the equivalent MSDOS
- X+ file names (\fB/dev/con\fR and \fB/dev/nul\fR respectively). Any user
- X+ programs which could expect \fB/dev/tty\fR or \fB/dev/null\fR as
- X+ arguments must do its own mapping to the MSDOS equivalents.
- X .SS Quoting
- X The following characters have a special meaning to the shell and cause
- X termination of a word unless quoted:
- X***************
- X*** 520,528 ****
- X the shell for normal processing. A history substitution takes the form:
- X .RS
- X .PP
- X! \fB!\fR \*(OK \fIstr\fR \(br \fInum\fR \*(CK \fIterminator\fR
- X .RE
- X .PP
- X \fB!\fInum\fR will place the history command with the specified number
- X in the command line. \fB!\fIstr\fR will find the most recent command
- X line that started with the characters in \fIstr\fR.
- X--- 568,577 ----
- X the shell for normal processing. A history substitution takes the form:
- X .RS
- X .PP
- X! \fB!\fR \*(OK ! \(br \fIstr\fR \(br \fInum\fR \*(CK \fIterminator\fR
- X .RE
- X .PP
- X+ \fB!!\fR will place the previous command in the command line.
- X \fB!\fInum\fR will place the history command with the specified number
- X in the command line. \fB!\fIstr\fR will find the most recent command
- X line that started with the characters in \fIstr\fR.
- X***************
- X*** 534,595 ****
- X manner described below.
- X .SS Command Line Editing
- X When reading input from an interactive terminal, certain keystrokes allow
- X! the current input line to be edited. The following keystrokes are
- X! available:
- X .TP
- X! .SM "Cursor Right"
- X Move the cursor right one character
- X .TP
- X! .SM "Control-Cursor Right"
- X Move the cursor right one word
- X .TP
- X! .SM "Cursor Left"
- X Move the cursor left one character
- X .TP
- X! .SM "Control-Cursor Left"
- X Move the cursor left one word
- X .TP
- X! .SM "Cursor Up"
- X Get the previous command from the history file
- X .TP
- X! .SM "Cursor Down"
- X Get the next command from the history file
- X .TP
- X .SM "Insert"
- X! Toggle insert/overwrite mode
- X .TP
- X! .SM "Delete"
- X! Delete the current character
- X .TP
- X! .SM "Home"
- X Move the cursor to the start of the command
- X .TP
- X .SM "End"
- X Move the cursor to the end of the command, unless the first character of
- X the command is a \fB!\fR, in which case the appropriate history search is
- X! done.
- X .TP
- X! .SM "Control-End"
- X Delete to the end of the line
- X .TP
- X! .SM "Page-Up"
- X Search backwards from the current history command for the next match against
- X! the last history request. This command can only be used after \fBEnd\fR has
- X! been used to select a history line.
- X .TP
- X! .SM "Page-Down"
- X Search forewards from the current history command for the next match against
- X! the last history request. This command can only be used after \fBEnd\fR has
- X! been used to select a history line.
- X .TP
- X! .SM "Backspace"
- X! Move the cursor back one character, erasing the current character.
- X .TP
- X .SM "Return"
- X Execute the command line, unless the first character of the command is a
- X! \fB!\fR, in which case the appropriate history processing is done.
- X .PD
- X .RE
- X .SS Execution
- X Each time a command is executed, the above substitutions are carried out. If
- X the command name matches one of the \fISpecial Commands\fR listed below, it
- X--- 583,753 ----
- X manner described below.
- X .SS Command Line Editing
- X When reading input from an interactive terminal, certain keystrokes allow
- X! the current input line to be edited. The following keystrokes
- X! corresponding to the following functions are defined in the initialisation
- X! file \fBsh.ini\fR. The keywords in the initialisation file which provide
- X! the functions are listed below:
- X .TP
- X! .B
- X! .SM "Right"
- X Move the cursor right one character
- X .TP
- X! .B
- X! .SM "WordRight"
- X Move the cursor right one word
- X .TP
- X! .B
- X! .SM "Left"
- X Move the cursor left one character
- X .TP
- X! .B
- X! .SM "WordLeft"
- X Move the cursor left one word
- X .TP
- X! .B
- X! .SM "Previous"
- X Get the previous command from the history file
- X .TP
- X! .B
- X! .SM "Next"
- X Get the next command from the history file
- X .TP
- X+ .B
- X .SM "Insert"
- X! Toggle insert/overwrite mode (note the shape of the cursor changes to
- X! indicate the current mode)
- X .TP
- X! .B
- X! .SM "DeleteRight
- X! Delete the current character unless the cursor is at the end of line when
- X! no action is taken
- X .TP
- X! .B
- X! .SM "Start"
- X Move the cursor to the start of the command
- X .TP
- X+ .B
- X+ .SM "Complete"
- X+ Attempt to complete the filename. The shell attempts to complete the file
- X+ name at the current cursor position. The file name is delimited by white
- X+ space characters. If the shell is unable to complete the file name (ie no
- X+ match can be found in the appropriate directory), the bell is rung. If a
- X+ single match is found, the new file name is displayed. If multiple matches
- X+ are found, the file name is replaced by the longest non-unique part of the
- X+ file name and the bell is rung.
- X+ .TP
- X+ .B
- X .SM "End"
- X Move the cursor to the end of the command, unless the first character of
- X the command is a \fB!\fR, in which case the appropriate history search is
- X! done. The cursor is placed at the end of the command line.
- X .TP
- X! .B
- X! .SM "Flush"
- X Delete to the end of the line
- X .TP
- X! .B
- X! .SM "ScanBackward"
- X Search backwards from the current history command for the next match against
- X! the last history request or the string currently in the command line if
- X! there has been no previous history request.
- X .TP
- X! .B
- X! .SM "ScanForeward"
- X Search forewards from the current history command for the next match against
- X! the last history request or the string currently in the command line if
- X! there has been no previous history request.
- X .TP
- X! .B
- X! .SM "Clear"
- X! Erase the complete line.
- X .TP
- X+ .B
- X+ .SM "Directory"
- X+ Display the file name list matching the partially entered file name under
- X+ the cursor. If no matches are found the bell is rung. To display the
- X+ whole directory, enter the directory name followed by a slash \fB/\fR.
- X+ After the directory listing has been displayed, the entered command line is
- X+ redisplayed.
- X+ .TP
- X+ .B
- X+ .SM "DeleteLeft"
- X+ Delete the character to the left of the cursor.
- X+ .TP
- X+ .B
- X .SM "Return"
- X Execute the command line, unless the first character of the command is a
- X! \fB!\fR, in which case the appropriate history processing is done. \fIThis
- X! is the actual key pressed and cannot be modified by the initialisation file.\fR
- X .PD
- X .RE
- X+ .SS Initialisation File
- X+ When the shell is run in interactive mode, the Command Line Editing keys
- X+ and other user configuration parameters are read from the initialisation
- X+ file \fIsh.ini\fR. This shell looks for this file in the same directory as
- X+ the \fBsh\fR executable which is running. It does not use the \fBSHELL\fR
- X+ environment variable or search the directories in the \fBPATH\fR
- X+ environment variable. At present, there are two types of entry in this
- X+ file: keyboard configuration; and others. The entry is contained in a
- X+ single line and consists of a keyword (in upper or lower case), white space,
- X+ an equals symbols, white space and one or two numeric values (see \fIstrtol\fR
- X+ for valid formats where \fIbase\fR parameter is zero), followed by an end
- X+ of line character.
- X+ .PP
- X+ For the keyboard entries, the numeric values give the MSDOS Function 8 (Console
- X+ Input without Echo) return values for that entry. Note that extended codes
- X+ (function keys) require two calls to this function. The first call returns
- X+ zero and the second the extended code. In the configuration file, a first
- X+ numeric value of zero indicates a extended code and must be followed by a
- X+ second value. A non-zero first numeric value must not be followed by
- X+ anything else on the line.
- X+ .PP
- X+ Other entries must only have one numeric value. A zero value disables the
- X+ function and a non-zero value enables the function. At present, there are
- X+ two other functions:
- X+ .TP
- X+ .B
- X+ .SM "Bell"
- X+ Enable/disable warning bells
- X+ .TP
- X+ .B
- X+ .SM "HalfHeight"
- X+ Use full or halfheight block cursor to indicate Insert mode
- X+ .PD
- X+ .RE
- X+ .PP
- X+ Invalid lines or lines beginning with a \fB#\fR are ignored.
- X+ .PP
- X+ The following table gives the list of valid keywords and their default
- X+ values:
- X+ .TS
- X+ box;
- X+ l l l l.
- X+ Keyword First numeric Second numeric Actual Key
- X+ _
- X+ KEYBOARD ENTRIES
- X+ ScanBackward 0 0x49 PAGE UP
- X+ ScanForeward 0 0x51 PAGE DOWN
- X+ Previous 0 0x48 UP ARROW
- X+ Next 0 0x50 DOWN ARROW
- X+ Left 0 0x4b LEFT ARROW
- X+ Right 0 0x4d RIGHT ARROW
- X+ WordRight 0 0x74 Control RIGHT ARROW
- X+ WordLeft 0 0x73 Control LEFT ARROW
- X+ Start 0 0x47 HOME
- X+ Clear 0 0x76 Control PAGE DOWN
- X+ Flush 0 0x75 Control END
- X+ End 0 0x4f END
- X+ Insert 0 0x52 INSERT
- X+ DeleteRight 0 0x53 DELETE
- X+ DeleteLeft 0x08 BACKSPACE
- X+ Complete 0 0x77 Control HOME
- X+ Directory 0 0x0f Shift TAB
- X+ _
- X+ OTHER FUNCTIONS
- X+ Bell 0
- X+ HalfHeight 0
- X+ .TE
- X .SS Execution
- X Each time a command is executed, the above substitutions are carried out. If
- X the command name matches one of the \fISpecial Commands\fR listed below, it
- X***************
- X*** 611,624 ****
- X anywhere else in the path list. If the command name contains a \fB/\fR or
- X starts with \fBx:\fR (where x is a drive letter) the search path is not used;
- X such commands will not be executed by the restricted shell. Otherwise, each
- X! directory in the path is searched for an executable file.
- X .PP
- X! If the file does not have a .com or .exe extension, it is opened and the first
- X! 5 characters are read. If the first 5 characters are the string
- X! \fB#!sh\\n\fR it is assumed to be a file containing shell commands. Note
- X! that the shell will check the file and if that file does not exist or is not a
- X! script, it will try the file with an extension of \fB.sh\fR. If a \fB.sh\fR
- X! file is found, that will be processed. A sub-shell is spawned to read it.
- X A parenthesized command is also executed in a sub-shell.
- X .SS Special Commands
- X Input/output redirection is permitted for these commands. File descriptor 1
- X--- 769,807 ----
- X anywhere else in the path list. If the command name contains a \fB/\fR or
- X starts with \fBx:\fR (where x is a drive letter) the search path is not used;
- X such commands will not be executed by the restricted shell. Otherwise, each
- X! directory in the path is searched for an executable file. Executable files
- X! are indicated by a .exe or .com extension. This extension is automatically
- X! supplied by the shell and not have to be entered by the user.
- X .PP
- X! If the file with a .com or .exe extension cannot be found in the
- X! directory, the file is opened and first 512 characters are read. If there are
- X! no characters in the block with a value in the range 0 to 7, the file is
- X! assumed to be a script file containing shell commands. Note that the shell
- X! will check the file and if that file does not exist or is not a script, it
- X! will try the file with an extension of \fB.sh\fR. If a \fB.sh\fR file is
- X! found, that will be processed. A sub-shell (given by the environment
- X! variable \fBSHELL\fR) is spawned to read
- X! it.
- X! .PP
- X! If the script file starts with the a line of the form \fI#! interpreter\fR
- X! \*(OK\fIarguments\fR\*(CK, the interpreter is invoked instead of the shell
- X! to process the script. Optional arguments can be supplied in the script
- X! file which are passed before the name of the script file. Thus, if the
- X! file \fIdemo\fR contained the following string as the first line
- X! .RS
- X! .PP
- X! #! perl -sP
- X! .RE
- X! .PP
- X! Entering \fIdemo name\fR would be equivalent to entering the \fIperl -sP name\fR
- X! at the command prompt. Note that no other processing of the first line
- X! other that the separation (by white space) into arguments is done.
- X! .PP
- X! If none of the above conditions for a executable file are detected and a file
- X! with a .bat extension exists in the directory, the command processor given by
- X! the \fBCOMSPEC\fR environment variable is spawned to process the file. This
- X! is normally the standard MSDOS \fIcommand.com\fR processor.
- X! .PP
- X A parenthesized command is also executed in a sub-shell.
- X .SS Special Commands
- X Input/output redirection is permitted for these commands. File descriptor 1
- X***************
- X*** 796,802 ****
- X \fBmsdos\fR \*(OK \fIname\fR ... \*(CK
- X The given \fIname\fRs are marked \fImsdos\fR format and if the \fB-m\fR flag
- X is set, the values of the these \fIname\fRs are exported to child processes
- X! with the any slashes in the value replaced by backslashes.
- X .TP
- X \fBpwd\fR
- X Print the current working directory.
- X--- 979,985 ----
- X \fBmsdos\fR \*(OK \fIname\fR ... \*(CK
- X The given \fIname\fRs are marked \fImsdos\fR format and if the \fB-m\fR flag
- X is set, the values of the these \fIname\fRs are exported to child processes
- X! with any slashes in the value replaced by backslashes.
- X .TP
- X \fBpwd\fR
- X Print the current working directory.
- X***************
- X*** 884,896 ****
- X swapped, the shell reduces the available memory by about 3K.
- X .TP
- X \fBexpand\fR
- X! Enable swapping to Expanded Memory. The EMS drive must exist on your
- X system for this to work.
- X .TP
- X \fBextent\fR \*(OK \fIstart address\fR \*(CK
- X! Enable swapping to Extended Memory. The optional start address defines the
- X! based address in the Extended Memory at which point the shell writes its
- X! swap area. The default location is \fI0x100000\fR.
- X .TP
- X \fBdisk\fR
- X Enable swapping to disk. The shell creates a temporary file and saves
- X--- 1067,1081 ----
- X swapped, the shell reduces the available memory by about 3K.
- X .TP
- X \fBexpand\fR
- X! Enable swapping to Expanded Memory. The EMS driver must exist on your
- X system for this to work.
- X .TP
- X \fBextent\fR \*(OK \fIstart address\fR \*(CK
- X! Enable swapping to Extended Memory. If you have an XMS driver on your
- X! system, the shell will use the XMS driver. Otherwise, the BIOS Interrupt
- X! 15 interface is used. The optional start address defines the based address
- X! in the Extended Memory at which point the shell writes its swap area when
- X! the BIOS interface is used. The default location is \fI0x100000\fR.
- X .TP
- X \fBdisk\fR
- X Enable swapping to disk. The shell creates a temporary file and saves
- X***************
- X*** 937,943 ****
- X true if the open file whose file descriptor number is \fIfildes\fR (1 by
- X default) is associated with a terminal device.
- X .TP
- X! \fB-n \fIs1\fR
- X true if the length of the string \fIs1\fR is zero.
- X .TP
- X \fB-n \fIs1\fR
- X--- 1122,1128 ----
- X true if the open file whose file descriptor number is \fIfildes\fR (1 by
- X default) is associated with a terminal device.
- X .TP
- X! \fB-z \fIs1\fR
- X true if the length of the string \fIs1\fR is zero.
- X .TP
- X \fB-n \fIs1\fR
- X***************
- X*** 1089,1094 ****
- X--- 1274,1285 ----
- X \s-1$HOME\s+1/profile.sh
- X .br
- X \s-1$TMP\s+1/sh\(**
- X+ .br
- X+ ??/sh.ini
- X+ .SH CRITICAL ERRORS
- X+ The Shell provide a Critical Error Handler (Interrupt 24) similar to the
- X+ standard MSDOS handler. In addition to the standard message, the handler
- X+ also displays the Extended Error Code information in hexadecimal.
- X .SH LIMIITATIONS
- X Any TSR (Terminate Stay Resident) programs must be loaded before loading
- X \fISh\fR as the shell will overwrite the TSR when it reloads itself after
- X***************
- X*** 1105,1110 ****
- X--- 1296,1302 ----
- X signal(2),
- X umask(2),
- X wait(2),
- X+ strtol(3),
- X profile(4),
- X environ(5) in the
- X \fI\s-1UNIX\s+1 System Programmer Reference Manual\fR.
- SHAR_EOF
- echo "File Patch1.6 is complete"
- chmod 0644 Patch1.6 || echo "restore of Patch1.6 fails"
- set `wc -c Patch1.6`;Sum=$1
- if test "$Sum" != "223824"
- then echo original size 223824, current size $Sum;fi
- echo "x - extracting Notes1.6 (Text)"
- sed 's/^X//' << 'SHAR_EOF' > Notes1.6 &&
- XVersion 1.6 Release Notes:
- X
- XThe following problems have been fixed in 1.6
- X
- X 1. Traps did now work correctly (as far as possible for DOS) la System
- X V.3
- X 2. File descriptor duplication closed standard input.
- X 3. !! has been implemented to return the previous command in the history
- X file
- X 4. erase_to_end_of_line has been improved/fixed
- X 5. The processing of . filename has been fixed so that the script is
- X now executed immediately. This is the area most likely to contain
- X bugs.
- X 6. History does not double prompt
- X 7. Bugs in the 'here' document code delete backslashes and prevented
- X `command` in a here document from working.
- X 8. Interrupting a pipeline could result in std??? remaining redirected
- X 9. exec >filename did not work
- X 10. Some temporary files were not deleted.
- X 11. The swapper failed to check for disk full errors
- X
- XThe following enhancements have been made:
- X
- X 1. /dev/tty and /dev/null are mapped to /dev/con and /dev/nul internally
- X 2. <up arrow> returns the previous history command
- X 3. <page up> will now search for the previous history entry matching
- X the entered string
- X 4. The shell determines the number of columns on the screen from the
- X BIOS
- X 5. Shell scripts are detected in a new manner. For a file to be a
- X shell script, it must contain no characters with values in the
- X range 0 to 7 in the first 512 bytes.
- X 6. #! <command> <arguments> processing on the first line of script files
- X has been implemented a la System V.4
- X 7. XMS drivers are now supported
- X 8. Some static buffers are now 'malloced' instead and some length
- X checks have been added
- X 9. Insert command selects a full or halfheight block cursor
- X 10. .bat files are processed by the shell specified by the variable
- X COMSPEC.
- X 11. UNIX format PATH variables are converted MSDOS format
- X 12. The shell attempts to find the number of lines on the screen from
- X the BIOS
- X 13. File name completion has been implemented
- X 14. Erase input buffer has been implemented
- X 15. A Configuration file (sh.ini) allows the user to configure the
- X editor keys
- X 16. Quoting of arugments with white space in them to MSDOS commands
- X has been added.
- X 17. Full internal Interrup 24 support is provided.
- X
- XThe following enhancements/bugs remain outstanding:
- X
- X 1. The processing of the escape character (\) is not consistent with
- X the System V shell. The MS-Shell always strips the first escape
- X character. The System V shell only strips escape characters when
- X it detects a shell special character following (Release 1.7).
- X
- X ie. echo "\033[H" works under System V however echo "\\033[H" is
- X required in the MSDOS shell.
- X
- X 2. 8 Bit character are not supported. This is tied in with the
- X processing of escape characters. The shell uses the 8-bit to
- X mark escaped characters (Release 1.7).
- X
- X 3. Reduce the amount of data written to swap file by only dumping the
- X data and stack space after the first write (Release 1.7+).
- X
- XThanks are due to
- X
- X Greg Yachuk
- X Leo Vermeulen
- X Lee Fisher
- X John B Thiel
- X Harry McGavran
- X Bill Davidsen
- X
- Xfor their comments, fixes, tolerance etc in testing release 1.6
- X
- XIan Stewartson.
- SHAR_EOF
- chmod 0644 Notes1.6 || echo "restore of Notes1.6 fails"
- set `wc -c Notes1.6`;Sum=$1
- if test "$Sum" != "3216"
- then echo original size 3216, current size $Sum;fi
- echo "x - extracting Notes1.5 (Text)"
- sed 's/^X//' << 'SHAR_EOF' > Notes1.5 &&
- XVersion 1.6 Release Notes:
- X
- XThe following enhancements have been included:
- X
- X1) Interrupt 24 processing is now handled correctly. The shell does not
- X exit on Abort, it terminates the system call instead.
- X
- X2) Some of the other interrupt processing has been cleaned up.
- X
- X3) A bug in the Interrupt 23 detection code in sh0.asm has been fixed
- X
- X4) The dependency on ANSI.SYS or NANSI.SYS has been removed (thanks to
- X Tom Horsley)
- X
- X5) A missing source acknowledgement in sh7.c for the test command code
- X has been added. The code came from Minix news group and was based
- X on the version written by Erik Baalbergen.
- X
- X6) The executable version of this release has been send to the moderator
- X of comp.binaries.ibm.pc.
- SHAR_EOF
- chmod 0644 Notes1.5 || echo "restore of Notes1.5 fails"
- set `wc -c Notes1.5`;Sum=$1
- if test "$Sum" != "731"
- then echo original size 731, current size $Sum;fi
- echo "x - extracting Patch.Lib (Text)"
- sed 's/^X//' << 'SHAR_EOF' > Patch.Lib &&
- X MS-DOS Shell Version 1.6 Patch.Lib March 1990
- X
- X MS-DOS SHELL - Copyright (c) 1990 Data Logic Limited and Charles Forsyth
- X
- X This code is based on (in part) the shell program written by Charles
- X Forsyth and is subject to the following copyright restrictions:
- X
- X 1. Redistribution and use in source and binary forms are permitted
- X provided that the above copyright notice is duplicated in the
- X source form and the copyright notice in file sh6.c is displayed
- X on entry to the program.
- X
- X 2. The sources (or parts thereof) or objects generated from the
- X sources (or parts of sources) cannot be sold under any circumstances.
- X
- X $Header: patch.lib 1.1 90/03/14 11:47:03 MS_user Exp $
- X
- X $Log: patch.lib $
- X Revision 1.1 90/03/14 11:47:03 MS_user
- X Initial revision
- X
- X________________________________________________________________________________
- X
- XThis document provides a set of instructions for modifying the Microsoft C
- Xv5.1 Library function open so that the O_NOINHERIT flag is passed to MSDOS.
- XThe CodeView commands are given where appropriate.
- X
- X1. Using CodeView (or a similar debugger), set a breakpoint on the call to
- X open in S_open.
- X
- X - v S_open
- X move cursor to open
- X - <F9>
- X
- X2. Execute to the break point. You may have to enter a command which opens
- X a file.
- X
- X - g
- X
- X3. Display the Assembly listing
- X
- X - <F3>
- X
- X4. Single step the debugger into the open function
- X
- X - <F8> (5 times on my system)
- X
- X5. Page through the assembler listing until you find the Interrupt 21 call.
- X In my version, this is about 16 assembler instructions into the open
- X function. The call sequence is:
- X
- X mov byte ptr [bp - 4], 80H
- X push ds
- X lds dx, dword ptr [bp + 6]
- X and al, 03
- X or al, bh
- X mov ah, 3d
- X int 21H
- X
- X6. Record the machine code values for this sequence (especially the last 4
- X instructions). On my system these are:
- X
- X 2403 and al, 03
- X 0AC7 or al, bh
- X B43D mov ah, 3d
- X CD21 int 21H
- X
- X7. Exit CodeView
- X
- X8. Extract the module open.obj from your library.
- X
- X lib llibce "*open.obj;"
- X
- X9. Using an appropriate binary editor (or hex dump program) look for the
- X sequence of machine code values leading up to the interrupt (see step 6
- X above). In my version of open.obj, it starts at offset 0x0f2 in the
- X file. Change the AND AL, 03 instruction to AND AL, 83 by changing 24
- X 03 to 24 83.
- X
- X You may have to write a little program to open the file in binary mode,
- X seek to the appropriate location and write 0x83 to the file and close
- X it.
- X
- X10. Re-load the module in the library (you may want to keep a copy of the
- X original module/library in case of problems).
- X
- X lib llibce "-+open.obj;"
- X
- X11. Re-link the shell
- X
- X12. Check that the AND AL, 03 has become an AND AL, 83 using steps 1 to 5.
- X
- XNote:
- X Microsoft, MSDOS and CodeView are registered trademarks of Microsoft
- X Corporation
- SHAR_EOF
- chmod 0644 Patch.Lib || echo "restore of Patch.Lib fails"
- set `wc -c Patch.Lib`;Sum=$1
- if test "$Sum" != "2900"
- then echo original size 2900, current size $Sum;fi
- echo "x - extracting ms_dio.2 (Text)"
- sed 's/^X//' << 'SHAR_EOF' > ms_dio.2 &&
- X.TH DIO_FUNCTION 2L "Data Logic Limited" "MS-DOS Version 1.1"
- X.SH NAME
- Xdio_functions - MSDOS Raw Disk/Memory I/O Functions
- X.SH SYNOPSIS
- X\fB#include <sys/types.h>
- X.br
- X#include <sys/stat.h>
- X.br
- X#include <fcntl.h>
- X.br
- X#include <ms_dio.h>
- X.sp
- Xint dio_access (path, amode)
- X.br
- Xint dio_chmod (path, mode)
- X.br
- Xint dio_close (fildes)
- X.br
- Xint dio_creat (path, mode)
- X.br
- Xint dio_dup (fildes)
- X.br
- Xint dio_isatty (fildes)
- X.br
- Xlong dio_lseek (fildes, offset, whence)
- X.br
- Xint dio_open (path, oflag\fR [ \fB, mode\fR ] \fB)
- X.br
- Xint dio_read (fildes, buf, nbyte)
- X.br
- Xint dio_stat (path, statb)
- X.br
- Xint dio_fstat (fildes, statb)
- X.br
- Xint dio_write (fildes, buf, nbyte)
- X.br
- Xlong dio_tell (fildes)
- X.sp
- Xchar *path;
- X.br
- Xchar *buf;
- X.br
- Xint amode;
- X.br
- Xint mode;
- X.br
- Xint fildes;
- X.br
- Xint whence;
- X.br
- Xint oflag;
- X.br
- Xlong offset;
- X.br
- Xunsigned int nbyte;
- X.br
- Xstruct stat *statb;
- X.SH DESCRIPTION
- XThese functions provide replacements for the standard MS-DOS library
- Xfunction of similar name. The object of these functions is to allow the
- Xuser to access either the files, or raw disks or memory using standard
- Xlibrary calls, in a similar manner to UNIX where files or devices can be
- Xaccessed using the standard library functions. A set of macros is provided
- Xin the include file \fBms_dio.h\fR which maps the standard library functions
- Xonto one of these functions. If the file name or file descriptor refers to
- Xa normal MSDOS file, the standard library function is invoked to perform
- Xthe required function. Otherwise, the appropriate action is taken by these
- Xreplacement functions. The functionality of the libraries is described on
- Xthe appropriate manual pages for the standard function.
- X.PP
- XThese libraries recognise three devices - hard disks, floppy disks or
- Xmemory and these are accessed using the following file names:
- X.PP
- X.PD 0
- X.TP
- X\fB/dev/fd\fIn\fR
- XThis device allows the user to access a floppy disk. The digit \fIn\fR
- Xgives the drive number (from 0 to 9). The topological information for
- Xthis device (heads, tracks, sectors) is obtained from MS-DOS. The open
- Xfunction then checks to see what type of disk is loaded. The following
- Xdisks are recognised (8, 9 or 15 sectors, 1 or 2 heads, double or single
- Xdensity). The drive density is selected when necessary by attempting to
- Xread sector 0 from the disk.
- X.TP
- X\fB/dev/hd\fIxy\fR
- XThis device allows the user to access a hard disk. The first digit \fIx\fR
- Xgives the drive number (from 0 to 9) and the second digit \fIy\fR gives the
- Xpartition number on the disk (from 0 to 9). Partition zero refers to the
- Xwhole disk. Note that the open function sorts the partition table before
- Xdeciding which partition is referred to. All topological information for
- SHAR_EOF
- echo "End of part 7"
- echo "File ms_dio.2 is continued in part 8"
- echo "8" > s2_seq_.tmp
- exit 0
-
-
-