home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
SHELLS
/
sh73.lzh
/
DOC
/
changelog.sh
next >
Wrap
Text File
|
1998-05-26
|
87KB
|
1,602 lines
Fix Date & Item
--- -----------
#73 05/27/98
Another step towards bash-compatibility: '~+' expands to the current
working directory (CWD environment variable) and '~-' expands to the
last working directory (LWD environment variable). Added a little
paragraph (beginning of section 6.) on the general concept of the
shell syntax.
#72 03/17/98
- The return value variable ($?) was cleared whenever an empty line was
entered, fixed.
>>>>>> General release. Upload to os9archive.rtsi.com.
<<<<<< Version 2.1, Edition 71.
#71 02/20/98
- The return value variable ($?) was incorrectly set, if a program was
executed within a grave construct, e.g. retstr=`prog`, fixed.
>>>>>> Production release for Kei Thomsen at Microware Germany (to be included
into OS-9 httpd contribution disk).
<<<<<< Version 2.1, Edition 70.
#70 07/20/97
- Removed a potential memory leak in one of the routines dealing with
OS-9 process tables (could only happen, if out of memory).
- Made a minor correction to the 'delfunc' example script.
>>>>>> Beta release to Ilja V.Levinson <lev@odusv.oduurl.ru>
#70b 06/26/97
- Added a paragraph to the manual section on compatibility between 'sh'
and 'shell' that describes (intended) differences in the search order
for programs and scripts.
- Any implicitly or not fully-qualified explicitly defined fork program
(either by specifying one of '@', '~*' or '*!' or using the '#!<prog>'
syntax) is now also searched in the PATH directories.
- Improved error message, if fork failed.
- The first characters of a script file may now specify '*!' in which
case the Mware shell 'mshell' is forked.
- Added example script 'adduser'.
adduser -?
Usage: adduser <login> <groupnumber> <usernumber>
Function: Create a new user login entry
Options:
(none)
<<<<<< Version 2.1, Edition 70beta.
>>>>>> General release. Upload to os9archive.rtsi.com.
#69 06/21/97
- The '~username' construct did not work correctly, if a user name
contained the '_' symbol, the name part before the '_' was not unique,
and the '_' containing user name appeared in the password file after
the other one, fixed.
<<<<<< Version 2.1, Edition 69.
>>>>>> Beta release produced for Kei Thomsen at Microware Germany.
#69b 05/17/97
- Mware installation scripts were no longer running under 'sh'! The
offensive line
ex isexec (unsplit /u0 ! zoo fu ! pax -ep -ef -purovf -)
contains a '(' symbol that 'shell' and 'mshell' consider as a surrogate
for a single quote but 'sh' (same as bash) takes as a subshell fork
request. Applied the following modification to 'sh' that is not
compatible to bash but should not cause problems while executing a
syntactically correct 'bash' script: The '(' is only taken as a
subshell fork request, if it is the first non-whitespace character in a
command; it is taken as a quote, otherwise.
- Appending to a device unable to seek, e.g.
echo 123 >>/nil
or
echo >+/nil
produced an error message. There is, however, no reason to consider
this as error condition ('shell' and 'bash' also do not); implemented
this feature.
<<<<<< Version 2.1, Edition 69beta.
>>>>>> Released for Microware. EFFO disk released.
#68 03/21/97
- Ctrl-E from keyboard sometimes sent signal 0 instead of 2 to the child
process, fixed.
- Reverse-incremental history search could only be left using one of the
arrow-left, arrow-right keys (normal and alternate settings); added
begin-of-line and end-of-line keys (normal and alternate settings) for
this purpose.
- If a built-in command such as 'set' or 'printenv' was preceded by an
initial assignment and redirected to a pipe, the dynamic pipe buffer
allocation did not work which could lead to a dead-lock; fixed.
- If an attempt was made to set a read-only shell variable, the
appropriate error message appeared but the variable was, nevertheless,
deleted. This bug appeared first in edition #66 when introducing
temporary variable assignments followed by a commmand.
- Introduced default shell variable PPID (parent process ID) that is
identical to ${~} and ${~1} - again to make 'sh' as compatible as
possible to big brother 'bash'.
- Introduced default shell variables PWD and OLDPWD. PWD is identical to
CWD (current working directory as set by 'cd' or 'cwd'), and OLDPWD is
identical to LWD (previous working directory as set by 'cd' or 'cwd').
PWD and OLDPWD are CWD's and LWD's counterparts in 'bash', the
variables CWD and LWD will be maintained for the sake of compatibility.
<<<<<< Version 2.1, Edition 68.
>>>>>> EFFO disk released.
#67 01/17/97
- Did you know that _gs_devn(path, buffer) requires a buffer of at least
42 (!) characters and not only 32 (as indicated in the manual), if the
first argument is an NFM path? This is why sh edition #65 and #66 did
no longer work, if invoked via chp and why the built-in command 'tty'
never worked on an NFM path. Fixed both.
- Added leading slash to the output of the built-in command
'tty [<port>]' to make it behaving similarly to the same command in
'bash'.
- Fork shells and other programs defined using the #!<prog> syntax are
now also searched in the directories contained in the PATH environment
variable, if not already in memory and not in current execution
directory.
<<<<<< Version 2.1, Edition 67.
>>>>>> EFFO disk released.
#66 12/30/96
- If an attempt was made to complete names in an NFS-mounted UNIX
directory without having sufficient user privileges to do so, 'sh'
could crash; fixed.
- Release incremented to V2.1.
- If a command was preceded by an initial assignment, e.g.
abc=123 sh -c 'echo $abc'
the variable was not made exportable and, therefore, not available in
the environment of the child process; fixed. The newly set variable may
now also shadow an already existing variable; the previous value and
all previous status settings (export, readonly etc.) are restored after
completion of the command. This construct is used by the X11 script
'xon' which can now be used to start an xterm client session under
OS-9 via rsh.
- If a built-in command such as 'set' or 'printenv' was called at a time
when more than 8k environment variables were available (long variable
names and/or long strings assigned to them), the pipe buffer was not
large enough leading to a dead-lock. This does not happen anymore,
since the pipe buffer size is adapted dynamically now.
- Expanded syntax of built-in commands 'export' and 'readonly'. These
commands may now be followed by an assignment. For example,
export MYTERM=vt220 USERLEVEL=power
causes the variables MYTERM and USERLEVEL to be set and made
exportable using a single command. It is entirely equivalent to
MYTERM=vt220 USERLEVEL=power
export MYTERM USERLEVEL
or
setenv MYTERM vt220
setenv USERLEVEL power
- Made 'printenv' a built-in command. This version excepts a single
argument or several ones, e.g.
printenv HOME USER
that are output, one per line, in the specified order. Unavailable
variables are silently ignored.
- Bus error no longer occurs, if EOF encountered while reading from here
document.
- Merging in append mode, e.g '2>>&3', did not work, fixed.
- Moved reserved path numbers (copy of standard paths and error message
file path) to _NFILE-4 to _NFILE-1. All remaining one-digit numbers
(3, 4, 5, 6, 7, 8, 9) are now available for user purposes and are
passed to a child process, if used.
- Improved error messages, if access of redirected files fails.
- If a redirection error occurred, the $? variable did not contain the
appropriate error number, fixed.
- Increased maximum size of history buffer to 500.
<<<<<< Version 2.0, Edition 66.
>>>>>> EFFO disk released.
#65 10/13/96
- If two grave constructs on the same input line were not separated by
white space, e.g.
echo `pwd`:`pwd`
end of the grave expression was not correctly determined, fixed.
- Implemented reverse-incremental history search (default key is Ctrl-r,
termcap capability identifier is 'kQ'). This 'sh' command line edit
function is similar to its implementation in 'Emacs' and 'bash': Browse
through the history lines from most recent to least recent entry. The
enter key executes the retrieved history line; left-arrow, right-arrow
and backspace are used to copy it to the command line; any other key
discards the history selection and resumes command line editing. A more
detailed description has been added to the manual.
- A shell script may now contain the backspace character - 'sh' no longer
considers such files as binary files.
- Implemented environment variable CDPATH. It may contain a colon
separated list of directories to search when the argument to 'cd' is
not found in the current directory (same as in 'bash').
<<<<<< Version 2.0, Edition 65.
>>>>>> EFFO disk released.
#64 08/21/96
- Implemented test options '-h' and '-L' (test whether argument is
the name of an existing symbolic link). This test always returns
false; it is provided for the sake of compatibility only.
- The first digit of the resized stack size (#<stack>) was not always
considered, fixed.
- Implemented 'select' language construct and PS3 environment variable
(same as in 'bash'). Added related paragraphs to the manual.
<<<<<< Version 2.0, Edition 64.
#63 07/01/96
- Any explicitly specified prefix './' in a command name is now silently
replaced by '$CWD/'. The command
sh ./script
can, therefore, be used to start the shell script 'script' from the
current data directory even without specifying the '.' in the PATH
environment variable. This feature was already available but has been
lost somewhere between edition 52 and 62.
- Sub-shell expressions '(...)' erroneously have been executed without
the '-x' flag set. Therefore, the script
list ill=egal; list /dd/startup
correctly aborted after the first command, but the script
(list ill=egal; list /dd/startup)
did not. Fixed this problem by defining the '-x' flag in sub-shell
expressions by default as required.
- If file or command name completion fails and the template string
contains at least one slash ('/') that is not the first character,
template matching is retried after conversion to upper case (for NFS).
- Command completion is now also enabled, if the word to be completed is
the first word after the concurrent or sequential execution symbol
('&' or ';') and there is exactly one space between the symbol and
the word.
- Any language construct element such as 'do' or 'for' and the built-in
command 'test' were not allowed as a case pattern, fixed.
>>>>>> EFFO disk released.
<<<<<< Version 2.0, Edition 63.
#62 06/18/96
- The non-interactive script syntax of 'sh' is now so similar to 'bash'
that it is justified to add a 'bash'-specific book to the bibliography
at the end of the 'sh' manual.
- A non-interactive shell script now correctly aborts after evaluating
${varname:?message}, if $varname is not defined or $varname has
zero length.
- A non-interactive shell script now correctly aborts after evaluating
${varname?message}, if $varname is not defined.
- Introduced the colon (:) in all four string substitution operators
${varname:-word}, ${varname:=word}, ${varname:?message} and
${varname:+word}. The colon optionally changes the behavior of the
string substitution in such a way that the value of $varname is only
returned, if $varname exists and has not zero length. Without the
colon, $varname is also returned, if it exists but has zero length
(same as in 'bash').
- Introduced string operator ${#varname} that returns the string length
of $varname, if $varname is defined, or an empty string, if $varname is
undefined (same as in 'bash').
- Command completion is now also enabled, if the word to be completed is
the first word after one of the two pipe symbols ('!' or '|') and there
is exactly one space between the pipe symbol and the word.
- The end-of-word search of the delete-word command (default Esc-D) was
the same as in upper-char-word (default Esc-U) and friends, i.e.
end-of-word was defined as the first re-occurrence of an alphanumeric
character and not as the first occurrence of a non-alphanumeric
character. The algorithm is now the same as in the word-forward
command (default Esc-F), i.e. all characters beginning from the current
cursor position to the first subsequent non-alphanumeric character are
deleted.
>>>>>> Released for MGR window manager 2.1.0b1.
<<<<<< Version 2.0, Edition 62.
#61 06/09/96
- One or more newlines may now occur between a function header, e.g.
'func()', and the subsequent brace ('{'), same as in 'bash'.
- If a number higher than the highest integer number was entered, 'sh'
silently truncated the number to the 31 LSBs. An appropriate error
message is now output.
- The size of the stack resizer string space was not correctly checked.
As a result, utter chaos could occur when an attempt was made to set
the stack to a number of more than 10 digits in length. The problem
became apparent when people tried to remove sticky modules (modules
that have the ghost bit set) from memory by entering something like
<any command> #100000000000000000
which now works as expected. By the way, <any command> must be a
binary program to be forked. If <any command> is a shell built-in
command (such as 'echo'), no memory is allocated and, in consequence,
no sticky module is removed.
- The arguments of the source command ('.') temporarily become sh's
arguments (so that they are available in the $1, $2 .. $n shell
variable). $0 is temporarily set to the name of the sourced file and
$# is set to the number of arguments. The behavior is now the same as
in 'bash'.
- Introduced command line argument '-w' to enable DCD line watching:
If 'sh' is a login shell and standard input path allows for installing
DCD loss signal using _ss_dcoff(), 'sh' installs SIGHUP. If this signal
is received, 'sh' recursively kills all child processes and then exits
returning error E_HANGUP (220).
- If a child dies with SIGHUP or error E_HANGUP (error 220) and sh is
interactive, sh no longer writes an error message but immediately exits
and returns SIGHUP or E_HANGUP, respectively.
- In 'bash', the language construct elements 'fi' and 'done' can be
followed by a redirection symbol in which case all output from the
preceding expression is redirected, implemented this feature.
Unfortunately, there is still a difference between 'bash' and 'sh'
for OS-9: if one or more commands within the then/fi or do/done block
also redirect an output path, 'bash' lets them override the block
setting but 'sh' for OS-9 does not.
- Made allocation of internal command line string dynamic. This prevents
'sh' from exiting with bus error, if its command line is *very* long.
<<<<<< Version 2.0, Edition 60.
>>>>>> EFFO disk released.
#60 05/05/96
- Introduced option -C that, if set, disallows overwriting a file by
redirected output. This option not only makes 'sh' more compatible to
'bash' but also allows to simulate the redirection behavior of 'shell'.
- Blank evaluation of grave constructs was not always performed.
- If a shell procedure was started with a quoted argument, the $1
variable did not contain all arguments.
- Words in debug output are now quoted with double-quotes; this makes
it possible to differentiate between a single word containing
whitespace and a word list.
- A syntax error in a command passed using the '-c' command line option
was correctly analysed and a correct message written to screen, but the
line in error was not displayed, fixed.
- If the last line of a shell script contained a background command, the
shell returned with error 210 (bad page address), since the assembly
interface to os9exec() erroneously called munlink() with a NULL
pointer. As a consequence, any calling shell procedure that had not the
'-nx' option set, was interrupted prematurely. Removed the munlink()
call, since it is not needed in our modlinkp-free version of os9exec().
- If a large number of words had been found during name completion,
it could take several seconds to return the memory to the system when
the words were no longer needed: made this MUCH faster.
- Made history line completion more flexible: i) Completion search starts
at current history line and ii) current history line is set to the
match line, if search was successful.
- Command completion in PATH and execution directory (-g option) can now
be interrupted (helpful, if one of the PATH dirs or exec dir is very
large or mounted via NFS and the TAB key was hit inadvertently as first
character in an empty input line.
- Display of commands found after command completion (TAB twice) can now
be interrupted.
- Empty brackets '( )' erroneously started an interactive shell. This no
longer happens, since 'sh' now does the same thing 'bash' and other
shells do: the sub-shell is forked with the -c option (exit after
reading and executing one command).
- A nonsense error message occurred, if sub-shell brackets were not
closed. Sub-shells were not correctly disassembled in functions.
- A syntax error in the command line was correctly analysed and a correct
message written to screen, but the line in error was not displayed,
fixed.
<<<<<< Version 2.0, Edition 60.
>>>>>> EFFO disk released.
#59 04/17/96
- The ')' bracket now closes a list similarly to ';' as it was always
the case in the original Bourne shell and in 'bash'. It is now possible
to write
if ( test -d /dd/CMDS ) then echo Exec dir found ; fi
all in one line (although there is really no reason to start a
sub-shell for the evaluation of the test command). Such constructs can
be found in UNIX makefiles.
- If 'sh' was started with arguments, e.g.
sh copy from to
and the first argument was an executable memory module ('copy' in
the example) but also another file in the PATH list or in the current
execution directory, the memory module was not considered. Under these
conditions, 'dsave' was unable to copy a file named 'copy' but tried to
execute the file as procedure, although 'copy' was available in memory.
<<<<<< Version 2.0, Edition 59.
#58 03/24/96
- Updated manual section 6.5. on shell variables accordingly.
- The Internal Field Separator IFS is now correctly handled for word
splitting after expansion and to split the input line of the 'read'
command into words.
- If the $* argument variable is expanded within double quotes, the
first character of the Internal Field Separator IFS is used to separate
arguments.
- If the $@ argument variable is expanded within double quotes, a
separate word is created for every argument.
- Removed the error check for line-feed characters in shell scripts,
since 'sh' for OS-9 now accepts both the Unix and the OS-9 line
delimiter in most cases. Line-feed does not yet work in here documents,
and in shell scripts that use specific OS-9 features. In case of syntax
error, the line in error is not yet correctly displayed, if line-feed
delimited.
<<<<<< Version 2.0, Edition 58.
#57 03/23/96
- Improved error message for non-interactively evaluated grave
constructs.
- Made the shell variable interpretation more similar to the way 'bash'
(and also the UNIX Bourne shell) does it: If a shell variable contains
white space, e.g.
cmd='mfree -e'
blank interpretation is implicitly done after interpretation of the
shell variable so that the single word components are available
separately. The above command can, therefore, directly be executed:
$cmd
Earlier versions of 'sh' for OS-9 displayed the error message
mfree -e: invalid path name
because the entire string (including the space between the two words)
was regarded as file name. The newly implemented blank interpretation
also takes place when loop variables are evaluated, e.g. the following
loop
a='1 2 3'
b='4'5'6'
for i in $a $b
do
echo $i
done
is now executed six times as in 'bash' and not two times as in earlier
'sh' versions.
- Made the 'read' command more similar to the way it is implemented in
'bash':
1. If a single variable is to be read, white space is maintained, e.g.
# read a
1234 5678
# echo "$a"
1234 5678
2. If more than one input variable is specified, whitespace is squeezed,
e.g.
# read a b
1234 5678
# echo "$a" "$b"
1234 5678
Section 8.30. of the manual now contains a correct description of all
implementation details of the 'read' command.
- The input buffer of the 'read' command in no longer limited in size but
is allocated dynamically (same as normal line input buffer).
- If the Bourne-shell comment symbol '#' was the first word in a line
and followed by a number, it was not recognized as comment but as stack
resizer, although this is also not a legal syntax in 'shell'.
- The built-in 'read' now accepts input from a pipe; this makes it
possible to realize a simple string parser, e.g.
# echo arg1 arg2 | read a b
# echo $a
arg1
# echo $b
arg2
- All intermediate pipes are now correctly closed - even if the pipe
symbol is (incorrectly) placed between a command and a shell built-in
that is not able to receive input from a pipe.
- Memory was not always correctly returned after executing F$Fork, fixed.
<<<<<< Version 2.0, Edition 57.
#56 03/17/96
- String space for grave expression is now allocated dynamically.
- Errors during grave evaluation did not necessarily stop the parser,
fixed.
- Unbalanced quotes in a grave construct could lead to an endless loop.
An appropriate error message is now written (same as in non-interactive
mode) and 'sh' no longer hangs.
- Replaced character macros by appropriate functions (another step
towards 8-bit compatibility - but still far away!).
- If an 'sh' procedure was called from system() without intermediate
shell, e.g. system("procedure arg1 arg2"), $0 as seen from the
procedure contained the entire string except just the procedure's name,
fixed.
>>>>>> EFFO disk released.
>>>>>> Released for MGR window manager, drop-in release V2.0.1.
<<<<<< Version 2.0, Edition 56.
#55 02/18/96
- Now! Grave constructs (`...`) are executed internally without
necessarily forking an intermediate shell. In consequence, shell
functions, aliases, scripts etc. can be executed in a grave construct.
Removed this item from todo list.
- Made 'sh' smaller by about 500 Byte: we now have our own os9exec() that
does not need modloadp() nor getenv(). In consequence, an interactively
modified PATH setting is also considered during evaluation of a grave
(`...`) construct.
- If an attempt is made to kill a process by specifying the name of a
module that is running more than once, the question whether to kill all
processes now also contains the device names of the first three I/O
paths of the affected process IDs.
- A concurrently running 'sh' task could hang, if a built-in command
was redirected to a named pipe and the size of the output data
exceeded the default pipe buffer size (usually 90 Byte). A
mechanism similar to the one already implemented for unnamed pipes
now also protects named pipes from such unwanted behavior.
- Modified sh's own termcap library in such a way that the TERMCAP
environment variable is taken from the current set of exported
variables. Any modification of the TERMCAP environment variable may,
therefore, made available to the current 'sh', if TERM is set to the
terminal type that is described in the modified TERMCAP string.
- If an attempt is made to kill a process by specifying the name of a
module that is running more than once, the question whether to kill all
processes now also contains the affected process IDs.
>>>>>> EFFO disk released.
<<<<<< Version 2.0, Edition 55.
#54 01/31/96
- Incremented version and edition.
- Implemented Mware's condensed I/O redirection syntax, e.g. "<>>>".
Removed this item from the list of incompatibilities to the Mware
shell, expanded related manual section.
- Implemented 'kill <name>' syntax to kill a process by its module name.
If the module is running more than once, a message is displayed so that
either all processes or none may be killed. Expanded manual section
accordingly.
- The prompt string (PS1) may now contain '\n' to indicate a new line.
- The at symbol ('@') is now also treated as start-of-filename character
for TAB file name completion. Helpful for completion of emacs script
names.
- The error message file is only opened when 'sh' is interactive or when
required.
- Linked patched version of termlib.l that references '/dd/SYS/termcap'
instead of '/dd/sys/termcap' so that it can also be used on systems
where /dd is mounted on a file server that distinguishes character case
in a file name.
- Not only the exclamation mark ('!') but also the caret symbol ('^') can
now be used to invert the sense of a character class in a regular
expression. For example, the two expressions
[!a-z]*
and
[^a-z]*
both match any files that do not begin with a lower case character.
- Optimized global expression matcher. Merged several functions into
one single module so that more functions can be inlined.
<<<<<< Version 1.8, Edition 54.
>>>>>> EFFO disk released.
#53 - 01/08/96
- Expanded automatic script execution: The following rules apply:
First character(s) of script Executor
# sh
@ zsh (new)
- shell
* shell
~* cfp (new!)
#!<prog> <prog>
The cfp-hack (~*) works quite well: Just include '~*' as the first
line into a cfp-script; the script may then be called by entering its
name as if it were a command. 'sh' will take care to fork 'cfp' and to
pass the script name as argument.
- 'sh' now behaves more similarly to 'shell' when standard input path
is redirected to a pipe:
1. When the pipe becomes empty, 'sh' no longer exits.
2. Prompt is displayed.
3. EOF is safely received when the process at the other side of the
pipe has exited.
- The above changes made it necessary to introduce a special mode when
'sh' has been forked by 'cfp':
1. 'logout' is not printed, if EOF is received.
2. No prompt is displayed.
- A bug in the expression matcher prevented quoted case templates that
contained a non-alpha character such as the underline symbol ('_') from
being correctly recognized, fixed.
- If a fully qualified script file had the execution attribute set,
its name was incorrectly appended to the name of the current execution
directory (e.g. '/dd/CMDS//dd/MYDIR/script') instead of being used
unmodified. Fixed this bug that also affected fully qualified script
files on an NFS device, even if they had the execution attribute NOT
set.
- Renamed 'changelog' to 'changelog.sh' so that it can go into a general
DOC directory without name conflicts with other changelog files.
- Optimized command line editing using termcap's 'ce' entry, if
available. Browsing through history with the cursor up/down keys is now
much quicker on vt100 and other terminals.
- Implemented $(<command>) evaluation syntax. 'ksh' uses this syntax
instead of the grave `<command>` syntax, but the behavior is identical.
- 'sh' no longer writes silly messages such as 'nowhere found', if a
shell script contains non-ASCII characters such as German umlauts etc.,
since 8-bit characters between 0xc0 and 0xff are now also accepted.
If, however, processed by 'sh', the sign bit of the 8-bit character is
lost.
- If a signal with a large number (>4424) was sent to sh, a bus error
occurred; this no longer happens.
- The parser was not always correctly reset after error processing, e.g.
# for i in 1 2 3
> echo
Word unexpected
# for i in 1 2 3
for: nowhere found
This irregular behavior has been fixed.
- The 'cls' function did not always work when executing a shell script,
fixed.
- Irrespective of whether logged out by 'Esc', aborted with SIGHUP,
SIGTERM or SIGTERMOLD, or by typing 'logout', the command 'logout' is
now always pushed onto history stack. An additional comment is added
to identify which one of the logout mechanisms was used. Only in case
the user regularly logged out by typing 'logout' (may also be aliased),
a comment is not appended.
- Renamed example script 'backup' to 'xcopy'.
- Modified debug output in trace mode.
<<<<<< Version 1.8, Edition 53.
>>>>>> Released for MGR window manager, final release V2.0.
#52 - 08/07/95
- If '-l' option is set, EOF can now be entered by hitting twice the
end-of-file character (normally Escape) at beginning of an input line.
EOF entered at prompt level causes 'sh' to logout; EOF entered in
'read' command causes the 'read' command to abort, to return false and
to leave the input variable unchanged.
- Here documents in functions now work - removed item from 'To do' list.
Temporary files for such here documents persist until the function is
removed (overwritten or deleted using 'set -f <name>). In addition,
'sh' implicitly deletes all functions before exiting, so that all
temporary files are safely removed.
- Enabled keyboard abort and keyboard interrupt when waiting for input
in built-in command 'read' (only if cursor at beginning of line).
Suppressed display of signal name, if '-i' option is not set, e.g.
during script execution.
>>>>>> EFFO disk released.
>>>>>> Released for MGR window manager 2.0b_p11.
<<<<<< Version 1.8, Edition 52.
#51 - 07/24/95
- Introduced '-f=<profile>' command line option to enable reading of a
user-defined profile file. It is processed last, i.e. after '~/.login',
'/dd/sys/profile' and '~/.profile' so that settings in these files may
be overwritten.
- Introduced '-r' command line option to suppress processing of default
profile files ('~/.login', '/dd/sys/profile', '~/.profile',
'/dd/sys/sh.logout' and '~/.logout' ).
- Strings that have been read using the 'read' command are now also
pushed onto the history stack.
- When 'sh' resumed execution after having forked a program that modified
the current keyboard mode, e.g. using the 'ke' termcap entry, the
keyboard mode was not updated appropriately, fixed.
- Commands in parentheses are now expanded before being processed.
- Arguments to the 'break' and 'continue' command were omitted from the
related description in the manual, added.
- When a 'break' or a 'continue' command appeared in nested for, while
and until loops and command execution resumed not at the outer loop,
the word list of the 'break' or 'continue' command was corrupted
resulting in bus error or other fatal problems. Fixed this bug that
was due to a conceptual problem in the rewind mechanism of the
execution stack.
- Introduced unsettable read-only variable SH_VERSION containing sh's
edition number.
- When Ctrl-C or Ctrl-E were hit during the built-in command 'read', the
message strings "Cancel" or "Interrupt", respectively, were written
twice, fixed.
- The '$HOME/.sh_history' file was not always correctly read, if the
-h=<lines> option was specified in addition to the HISTORY environment
variable, fixed.
- Improved error handling of the command line argument parser. This also
provides correct return values of the 'set <option>' built-in command.
- Implemented language construct element '!' (not) that may appear after
'if', 'elif', 'while', 'until', '||' and '&&'. For example, the command
sequence
if condition
then
:
else
command
fi
can now be written as
if ! condition
then
command
fi
The syntax is equal to the syntax implemented in 'bash' and is intended
for better readibility of the script code. Expanded descriptions
of the 'if', 'elif', 'while', 'until', '||' and '&&' constructs in the
manual and added new paragraph describing the '!' language construct
element.
- Display of variables and functions ('set' command) can now be
interrupted.
- Interactive loops could no longer be interrupted, fixed.
- Modified effect of the '-i' option: Shell error messages are now only
printed, if this option is set. This is the default in an interactive
'sh' session. During execution of an 'sh' script, by default this
option is not set so that shell error messages are suppressed.
- Break/continue level was corrupted after function execution as part
of an 'if' construct, fixed.
- Display of alias and history lists can now be interrupted. Pending
interrupts are now always processed before entering the line editor.
- Improved error message, if execution fails: When an invalid path name
is specified, 'sh' no longer writes "not found" but the correct error
message "invalid name".
<<<<<< Version 1.8, Edition 51.
>>>>>> EFFO disk released.
#50 - 06/27/95
- Rewritten the argument parser so that the entire command line is
always treated as if it had been entered as an interactive command.
In consequence, any legal 'sh' command line can now be passed to the
C library function system(), if the SHELL environment variable is
set to 'sh'. This includes grave constructs as well as shell variables
etc.
- Improved termcap sequence to erase edit line from cursor to end of
line.
- The SHELL environment variable is no longer considered by 'sh'!
Procedure shell is 'sh', if not specified otherwise ('*' or '-' as
first character in a script or using the '#!<prog>' syntax).
- Sorry! Although I did my very best, I was unable to keep my promise
to let sh not exceed 64 kByte in size. I will, of course, continue to
keep it as small as possible.
- Reworked the debug option: debugging may now be specified either using
the '-[n]d' option (as before) that enables all trace modes or using
the newly available '-[n]d=<mode>' option syntax to separately enable
or disable a specific trace mode. The argument <mode> may be one of
'args', 'evalg', 'fork', 'grave', 'insert', 'match', 'search' or
'trace'. In addition, the SHDEBUG environment variable is now set
accordingly whenever debug mode changes so that all subsequent shells
are set, by default, to the same debug mode as the parent shell. It is,
however, also possible to explicitly set SHDEBUG to another value.
Values and significance of the <mode> strings are explained in the
manual.
- Redefined the 'kS' termcap capability (default Ctrl-G) that was used to
clear the history buffer and to reset the terminal's SCF options. Now,
it only resets the terminal options and no longer affects the history
buffer. The history buffer can be cleared by entering the
history 1
history <num>
command sequence.
- Implemented two new modes to the 'history' command: when 'history read'
is entered, the file '$HOME/.sh_history' is read in the same way as
when 'sh' starts. The current contents of the history buffer are
written to '$HOME/.sh_history' when 'history save' is entered (same as
at logout). In addition, 'history' now writes a usage message, if '-?'
or an invalid argument is entered.
- Every time the size of the history buffer is redefined, the environment
variable HISTORY is now updated implicitly. Changing the value of
HISTORY using the
setenv HISTORY <num>
command does not influence the current history buffer size, but the new
value is taken as default buffer size in any subsequently started
interactive 'sh' session. Added related paragraph to the manual.
- Made 'pd' even more similar to the way Mware does it. This was required
for a file manager that has DT_RBF descriptors but, actually, refuses
to do many things RBF does. Unfortunately, Mware's pd works with it...
- Mware's comment symbol '*' (if at beginning of a line) was not
re-enabled after execution of a case...esac block. Normally, it is only
disabled when parsing a case construct to allow for wildcard case match
conditions, since they often start at the beginning of a line.
<<<<<< Version 1.8, Edition 50.
>>>>>> EFFO disk released.
#49 - 06/19/95
- The '$-' variable did not always reflect the currently set options
correctly.
- Empty strings could lead to a bus error during function search, fixed.
- The rest of a line in error was not always discarded completely as it
should.
- The first line of a multi-line block (such as 'do...done') was not
allowed to have a reserved syntax element at any position in the line
and not only as first word as it should, fixed.
- Implemented 'w' command that waits for any one child process to
terminate (compatibility to the Mware shell).
- Added error check to the 'wait' command: an error message is produced,
if the specified process id is not a child process.
- Implemented history line completion: if the first character of an input
line is the exclamation mark ('!') followed by a match string and the
completion key is entered, the most recent history line that matches
the string is inserted. History line completion never reports more than
one match, even if there are less recent entries that also match. In
contrast to the other completion modes, history line completion is not
limited to words - the entire history line including any white space is
inserted. If the exclamation mark is followed by a number, the history
line at this line number is taken. This makes it now possible to easily
recall and edit a less recent history line - many people asked for this
feature.
- The 'echo' command wrote a zero character when an empty backslash
expression was specified, fixed.
- Command name completion improved: Matching strings are still ordered
alphabetically but the groups appear now in the same order as they
would be considered for execution. In addition, the display of the list
with matching words can now be interrupted.
- Added '-m' option to the built-in command 'test' that returns true, if
the argument is an existing memory module. Note that this does not
imply that a process can link to it.
- Modified getwd() so that it is more compatible with the way Mware does
it.
- Subdirectories of PATH directories were not searched for executable
files, fixed. Added '[search]' output to debug mode.
- The 'version l(anguage)' command erroneously did not display ')' as a
legal language construct element. The manual only contained a
description of ')' as part of the 'case' syntax; '(<command>)' was
not explained in the manual. Fixed both.
- Name completion is now also set to command name completion, if the
character before the word to be completed is a grave ('`') symbol.
- Modified error string "neither in PATH dirs nor in exec dir found",
since it would be correct to say that the name could not be found as
alias, function, built-in command, memory module, file in a PATH dir or
file in exec dir but this would probably provide confusion rather than
explanation. So we simply say "nowhere found".
- Fixing the below bug also removed another problem from the name
completion function that could cause memory leakage.
- Fixed a nasty bug that could produce a bus error when TAB name
completion was attempted, more than one match were found, and a
character was then entered that caused 'sh' to quit line editing (such
as CR or Interrupt).
- Added escape sequence '\a' (alert) to built-in command 'echo' that lets
the terminal beep (0x07).
- First argument in shell scripts again was 'sh' instead of procedure
name. This already fixed bug was re-introduced when making 'sh'
compatible to Mware's 'login'.
- Empty strings in error and other messages are now displayed as
'<empty>'.
- Improved check whether one of the arguments to the 'read' command
specifies an invalid variable name.
- The 'clear screen' keycap sequence (Ctrl-G, kS) now restores the
initial terminal setting in addition to saving and clearing the history
buffer. Helpful when 'sh' has forked a program that did not restore the
terminal settings appropriately. The description of this keycap
sequence was omitted in the manual, added.
- Expanded file name completion to a more general name completion:
1. If the first word in a line is being completed, commands are
matched. A command can be an alias, a shell function, a built-in
command, an executable program in the module directory or, optionally
(-g) a file in one of the execution directories (PATH variable or exec
dir).
2. If the first character of the word to be completed is a '$'
character, shell variables are matched (variable name completion).
3. If the first character of the word to be completed is a '~'
character, user names are matched (user name completion).
4. If none of the above applies, file names are matched (file name
completion). Modified the manual accordingly.
- Unsuccessful history match strings are now written to history buffer
so that they may be retried after editing.
- A bus error occurred when a history match was attempted but the
history buffer did not contain at least one valid entry, fixed.
- Made 'sh' about 2 kByte smaller by splitting C library modules into
smaller ones.
- Parentheses could not be used in test syntax, fixed. Added description
of such parentheses to the manual.
- In functions, the $# variable erroneously also considered the
function's name, i.e. it contained 1 when a function was called without
arguments. Now, it only contains the number of passed arguments as
required.
- Empty strings were passed to functions and programs, fixed.
<<<<<< Version 1.8, Edition 49.
>>>>>> EFFO disk released.
#48 - 06/07/95
- Made error message in case of test syntax error more verbose; in
addition, the line in error is now displayed and the offensive token
is marked.
- Unary test operators in string comparisons such as
opt=-x
if [ $opt = -x ]
then
echo hit
fi
were not accepted, since the syntax checker did not allow more than
one syntax element after the unary operator. This has been fixed: if
an unary operator is immediately followed by a '=' or '!=' syntax
element, the string comparison has priority.
- The "-?" string was taken as part of a wild card expression and global
match was attempted. This did not result in a user-noticeable bug, but
unnecessarily slowed down execution speed.
- When an alias was entered that specified a built-in command such as
'alias h history' and the standard output was redirected into a pipe,
the pipe's buffer size was not adjusted as it should so that 'sh' could
hang, fixed.
- If TOP's 'logon' is not available, Mware's 'login' is used to execute
the built-in command 'logon'.
- Alias expansion was enabled when searching for a case match string,
fixed.
- Improved syntax error message further.
- The built-in command 'chd' looped endlessly, if the new directory did
not have a correct OS-9 file structure with '.' and '..' entries in the
root level; a work-around is now provided.
- Made backslash processing in single and double quotes more similar to
'bash'.
- The syntax error message now contains the relative line number and the
line in error, if 'sh' is not interactive.
- Added '-p' option to the 'test' command; true if <arg> is an existing
path and is a named pipe.
- Did you know that
access("name", S_IWRITE);
does an
open("name", S_IWRITE);
which implicitly updates the date of the file's last modification?
This is the reason why
test -w name
unexpectedly also touched the file. Now, access() is no longer used so
that the last modification date remains unaltered after testing whether
a file has write access or not.
- When 'sh' was used in conjunction with the Mware 'login' instead of
the UNIX-compatible 'logon', 'sh' could not cope with the fact that
'login' passes the unprocessed password entry to the shell irrespective
of whether it contains white space or not. Added several workarounds
for this purpose.
- Break/continue level was corrupted after function execution, fixed.
- When 'unset' was entered with more than one argument and one of the
arguments specified a non-existing variable, 'unset' returned but did
not consider any remaining arguments as it should. Added '-?' usage
option to 'unset' and 'unsetenv'.
- Not any form of a regular expression was correctly considered during
TAB file name completion.
- Implemented selective stack checker so that a recursion such as in
func() {
func
}
func
no longer leads to a bus error but lets sh write an appropriate error
message and recover gracefully.
- The function re-assembler sent several spaces and carriage returns to
standard error path instead of standard output path.
- Repaired the 'case' syntax scanner and 'case' function re-assembler.
Several match conditions can now be or-ed together. Added example
function 'delfunc' to the list of shell scripts.
- The '[' symbol (alternative for 'test') was erroneously taken as part
of a regular expression and global match was attempted. This did not
result in a user-noticeable bug, but unnecessarily slowed down
execution speed.
- Added '[match]' output for debugging purposes.
- Enhanced syntax of 'setuid' command: argument may now be one of both
group.user number or user name, added '-?' option.
- File name completion now also works on pipe devices.
<<<<<< Version 1.8, Edition 48.
>>>>>> EFFO disk released.
#47 - 05/13/95
- An incorrect error was returned, if redirection to a file failed during
script execution.
- The dot ('.') is no longer a valid part of a shell variable name;
therefore, a suffix can now be appended to a shell variable without
enclosing the variable's name into braces (with respect to this,
'sh' now behaves exactly like 'bash'). For the sake of compatibility,
however, variables with a dot-containing name are still accepted and
can be set using 'setenv' and '<var>=<value>' but can only be recalled,
if their name is included in braces '${name.dot}'.
- The 'unset' command generated an error, if an attempt was made to unset
a non-existing variable. This was incorrect.
- Redirection to a file in directory '/tmp' is silently done to
'/dd/tmp'.
- When the 'Clear screen' key (kc) was entered during interactive input
of a here document, the wrong prompt was shown; fixed.
- The EOF mark of a here document may now contain virtually all available
characters (except, of course, white space), as sometimes used in sh
scripts from GNU software (e.g. '!GROK!HERE!' etc.).
- History search symbols and aliased words were erroneously evaluated
in here documents, fixed.
- If 'fi' is followed by a redirection symbol, 'sh' no longer crashes
with a bus error.
- The 'for i do' syntax (loop through all command line arguments)
required a new line between 'i' and 'do', fixed. The 'for i in <list>'
syntax always requires a new line before 'do' (same as 'bash').
- Before forking a shell for script execution, the SHELL environment
variable is now temporarily set to the shell that is used for script
execution.
- 'set -h=<history>' could lead to a bus error, fixed.
- The current keycap setting may now be inspected using the 'version
[k]eycaps' command.
- Improved usage message.
- Terminal editing may now be made non-blocking ('-nb' option), i.e.
sh's standard input device may be used as output by another program
even while sh interactively waits for the next character to be entered.
Default is blocking (the default SCF behavior).
- The escape character (0x1b) is now accepted in a shell script.
- Expanded paragraph on debugging: added a list that explains the various
debug messages.
- Warning, if 'read' specifies an illegal variable name.
- 'NO CARRIER' did no longer work, fixed.
- Improved selection mechanism to check whether a file can be used as
executable program or procedure file or whether it must be skipped.
- Improved error message, if input comes from binary file.
- Fixed a bug that caused quotes and double-quotes to disappear in
`...` constructs.
- Not only shell arguments ($0, $1, etc.) but also globals (wild cards,
regular expressions) in grave constructs are now evaluated before the
`...` string is executed.
<<<<<< Version 1.8, Edition 47.
>>>>>> Released for MGR window manager 2.0b.
#46 - 04/15/95
- Release number incremented, version number is now 1.8.
- Shell arguments ($0, $1, etc.) in grave constructs are now correctly
evaluated before the `...` string is executed. Happily removed this
topic from 'To do' list.
- Function disassembling as part of the 'set' command caused a bus error
when any one of the redirection symbols was encountered. Fixed another
bug that caused I/O merging (e.g. 2>&1) to be disassembled incorrectly.
- Added paragraph on debugging to the manual.
- The name of the currently running shell module is now used to evaluate
grave constructs and no longer the shell that is specified in the SHELL
environment variable.
- The manual has now a paragraph (4.3.) that gives a detailed description
of all available line editing commands.
- Added 'abandon line' edit command. The current edit line is copied into
paste buffer, the string "* Abandon *", a carriage return and a new
prompt are written to screen, and the current edit line is cleared.
Expanded related paragraph in the manual.
- When 'sh' was in Mware mode, here documents were not closed, fixed.
- When a syntax error was detected while 'sh' was in '-nx' mode (ignore
errors) command execution was blocked, fixed.
- When 'suspend <signal>' was executed all other signals were blocked.
Only the specified signal is now blocked, commands for other signals
that have been installed using the 'trap' command are still executed.
- Made 'pd' and 'pwd' shell built-in commands.
- The shell built-in 'exit' without an argument always returned 0 and
not the exit status of the last command executed as it should, fixed.
- The command 'cd -' is now equivalent to 'cd $LWD', i.e. the most
recent directory is made the current directory (same as in 'bash').
- When standard output was redirected to an already existing file that
was longer than the newly written output, the old file length was
maintained, fixed. This bug was inserted during implementation of the
'umask' built-in command.
- Actually, 'sh' uses only very few C library functions from the cio trap
handler so that the cio-free version is only 4 kByte smaller than the
cio version but requires about 16 kByte more static memory at run-time.
It is, therefore, decided to distribute the cio-free version only.
This facilitates distribution, gives complete OS-9 V3.0 compatibility
and saves system memory, especially if sh is running more than once.
In addition, sh may now be forked directly from sysgo without appending
the cio trap handler to the OS9Boot file.
- Increased maximum number of aliases to 100.
- A strange error message ("File not found") was written, if the end mark
of a here document was not found. A correct error message is now
written instead.
- TAB file name completion no longer requires a first character to be
entered, so that <TAB><TAB> after a space displays all files in the
current directory. If more than 100 files are available, the user is
given the possibility to suppress the display.
- Improved deletion mechanism for temporary files that are created for
here documents (yes, again!). Temporary files for quoted here documents
are now also deleted correctly.
- Improved error message in case a here file cannot be opened.
- 'test -t <arg1>' required a path name as argument and did not work when
a path number was specified, fixed.
- Written script 'backup' that is based on
cd $destination
(cd $source && tar c - *) | tar x -
and added to the collection of shell scripts in the SCRIPTS directory.
- Some Mware script files contain the (questionable) syntax
<command> & ;* <comment>
that was not tolerated by sh. It is now considered valid, if not in
Bourne mode, but only during script file execution. The same applies
to nonsense such as ';;;' or '&&&' which is now accepted in Mware
mode scripts, but not interactively.
- Improved error description in case of syntax error (small changelog
entry but important enhancement).
- Implemented built-in command 'umask', added related paragraph to the
manual.
#45 - 03/19/95
- Escaped dollar within double quotes is now taken literally and the
escape character is omitted as it should.
- Backslash processing for octal and hexadecimal numbers did not always
work as expected; fixed and expanded the related paragraph in the
manual.
- The backslash character in single quotes was not ignored, fixed.
- Added 'nohist' argument to the 'logout' command. It prevents 'sh', if
specified, from saving the current contents of the history buffer
to '$(HOME)/.sh_history'.
- When a test command was evaluated to be false and the related 'fi'
command was reached, the $? return variable was not reset, fixed.
- If a command could not be executed, the $? return variable erroneously
was set to 0 and not to the appropriate error number, fixed.
- Aliasing did not work, if the alias was not a straight command. The
following lines, for example,
alias mkdir makdir
if [ ! -d /dd/DIR ]; then mkdir /dd/DIR; fi
now work without problem.
- The closing grave must no longer be at the end of a word so that
assignments such as val="`echo 123`" now work (such expressions can
sometimes be found in makefiles from operating systems other than
OS-9).
- 'sh -c' without further arguments caused endless loop, fixed.
- If sh is executing a script, the $0 argument variable no longer
erroneously contains 'sh' but the name of the script.
- The result from a grave construct is now (internally) quoted when
assigned to a shell variable so that it may contain carriage returns.
The 'set' and 'show' commands now indicate such carriage returns by
displaying '\n'; other non-printables are also escaped.
<<<<<< Version 1.7, Edition 44.
>>>>>> EFFO disk released.
#44 - 02/05/95
- Added termcap entries 'ks' (start keypad transmit mode) and 'ke' (end
keypad transmit mode). The 'ks' string is sent when sh enters
interactive mode after the TERM variable is set or modified. The 'ke'
string is sent before sh is finishing.
- When sh was started with the -c option, return code was not always
correct, fixed.
- The termcap data base is now only searched when sh goes for the first
time into interactive mode (and, of course, when TERM changes). This
avoids irrelevant error messages when TERM is only set in '.login',
'/dd/SYS/profile' or '.profile'.
- The dot command did not try the unprefixed file name in case PATH was
undefined or did not contain the '.' entry.
- Error message that TERM is not defined or not found appeared also in a
non-interactive shell session, fixed.
- Basic09 I-code is now correctly executed through 'Runb'.
- Yeap! The asterisk at start of line and after semicolon is now treated
as comment as in the Mware shell. In addition, an internal flag is set
to Mware mode. Every subsequent occurrence of the '>>' symbol is then
no longer recognized as append mode but as redirection of the error
output path. The internal flag is reset to Bourne mode when the normal
comment symbol '#' is encountered. Apart from less important
differences, 'sh' and 'shell' are now COMPATIBLE!
#43 01/23/95
- Input lines could be corrupted due to a pointer problem that was
introduced when the word buffer was made dynamic, fixed.
- Removed the restriction that the TERM environment variable cannot be
unset.
- More than one option could not be specified in the command line, fixed.
The same argument parser is now used for command line options and for
the 'set' built-in command.
- Any built-in command can now be interrupted using keyboard abort and
quit (helpful for never ending loops etc.).
- The name of a non-existing file in the -e=<file> option caused a bus
error, fixed.
- The -s option can no longer be set when in interactive mode.
- Shell built-in commands in error stopped script execution in any case,
irrespective of the '-x' flag setting, fixed.
- When a binary file was specified in a situation where a script file was
expected, utter chaos could result; this is now intercepted.
- Under rare conditions, sh could write the nonsense message "Signal #0
received', fixed.
- Built-in shell commands such as 'chd' and 'echo' are no longer
case-sensitive except, of course, the 'NO CARRIER' hack.
- The '.' and '..' directory entries are no longer considered when a '.'
or '..' search string is followed by a wildcard or regular expression.
In other words, 'dir .*' now lists only the files whose name starts
with the '.' character (as it was always the case in the Mware shell).
- 'sh <cmd>' did not work, if <cmd> was an executable program in the
current working directory, fixed.
- The '$?' return value incorrectly contained -1 when a program failed to
execute, it now contains the program's exit code.
- Adapted 'unset' and 'unsetenv' to make them as compatible as possible
to the original Bourne shell, to 'csh' and 'bash'.
- Directory for temporary files is now silently created, if not yet
available.
- Unused temporary files are now removed more efficiently.
- Reworked the input parser. Word buffer is now also allocated
dynamically so that the length of both input line and input word
is no longer limited by anything else than by the system's memory
size (was necessary for very long TERMCAP environment variables).
- An empty EMSG_FILE string could cause trouble, fixed.
- Backslash processing was not disabled when collecting from a grave
construct, fixed. Corrected 'which' script appropriately.
- Introduced additional variable flag that prevents globally needed
variables such as 'SHELL', 'TERM' etc. from being deleted.
- The first entry of the directory stack can no longer be removed. it is
set to the initial current working directory.
- Fixed a nasty bug that caused an endless loop when a local procedure
file had the same name as an executable in the current execution
directory.
- Removed all buffered I/O so that the size of the cio-free version
'sh_nocio' decreased to about 59 kByte.
- Added environment variable 'SHDEBUG' which, if set, forces '-d'
option to be set on all dependent sh calls. Added more output
to the '-d' option.
<<<<<< Version 1.7, Edition 42.
>>>>>> EFFO disk released.
#42 01/14/95
- Added 'strcmp.doc' to the distribution and replaced 'strcmp' by an
updated version (thanks Martin!).
- Reduced requirement for static storage from about 12 to about 10 kByte.
- The string or part of string that has been cut with any of 'Clear to
end of line', 'Delete current line' or 'Word delete' is now saved to a
cut buffer from where it can be retrieved using the newly available
'Paste' command. It is set to Ctrl-Y by default but can be assigned to
any other string using the 'Ki' termcap entry.
- Changed SIGTERM from 10 to 36 (OS-9 V3.0).
- Another step towards 'tcsh'/'bash' compatibility: Added shell built-in
commands 'dirs', 'popd [+n]' and 'pushd [+n] | [dir]', (thanks to
Wolfgang for all the helpful proposals!).
- TAB in a `...` construct caused bus error, fixed.
- Added shell built-in command 'suspend [<signal>]'.
- The key code for 'Delete current line' was no longer set to ^X by
default, fixed.
- Added SYS directory that contains a newly provided example password
file and the files 'dot.login' and 'dot.profile' from the SCRIPTS
directory.
- Reworked help and error messages for shell built-in commands (again!).
- Added shell built-in commands 'builtin', 'enable' and 'tty'.
- Reduced maximum number of history lines to 100.
- Alias expansion accepted not only white space but also all other
non-alpha and non-number characters in front of the search string,
fixed.
- Introduced '-y' option: If standard input path is not a TTY, standard
output and standard error paths are examined. The first of them being
a TTY is used as input path for the entire shell session. This feature
is required for sh-scripts that are started from the Mware shell and
use the read command, e.g. for installation purposes. Added
'install.shell' and 'readvar' to the collection of shell scripts.
- Reworked the 'read' command so that all line editing features are also
available when the command is part of a shell script.
#41 01/02/95
- Improved syntax, error handling and help messages of the built-in
functions 'setpr' and 'setstack'.
- Expanded the doc paragraphs that deal with shell functions.
- 'return' without argument led to a bus error, fixed (zero is now
returned in such case).
- If the output of a shell built-in command is redirected into a pipe,
its size has no longer default length (512 Bytes) but is set to
8192 Bytes. In consequence, output from 'alias', 'history', 'set' etc.
may now be sent through a pipe, e.g. 'alias | grep <search>' or
'history | more'.
- Reworked sh's output paths: in principle, messages and infos such
as 'alias', 'history', 'set' etc. will go to stdout, error messages
will go to stderr.
- An uninitialized string pointer variable could lead to a bus error
when working with here files, fixed.
- Keyboard mode is now also correctly reset when stdout and/or stderr
is redirected.
- The '#!<prog>' construct may now contain white space between '!'
and <prog>.
- TAB file name completion now also works with names of redirected files
(starting with any of '-+<>').
- Improved the algorithm that inserts 'set ' at the beginning of an
input line when Mware style options are entered.
- OS-9 V3.0 uses '_$temp$_<xxxx>' as template for the names of temporary
files where <xxxx> is a hexadecimal number. Unfortunately, any shell
program that supports shell variables will look up the shell variables
'temp' and '_<xxxx>' when such a file name is entered. The lookup
function needed, therefore, a major hack: Whenever the shell variable
'temp' is evaluated and the next character of the input stream is a
'$', the string '$temp$' is returned unprocessed. The above procedure
would, of course, not be necessary for normal terminal input, since the
'$' character can be entered explicitly when preceded with a backslash
('_\$temp\$_<xxxx>'); it is, however, required for the cfp program when
SHELL is set to 'sh'.
- Added ${~n} variables that contain the grandparent process IDs. The
expression '${~0}' is equivalent to '$$', and the expression '${~1}'
is equivalent to '${~}'.
<<<<<< Version 1.7, Edition 40.
>>>>>> EFFO disk released.
#40 12/04/94
- Incremented version number to 1.7.
- A dummy write to standard output path is now executed every time the
option section of the standard input path is changed. This ensures that
keyboard abort and keyboard interrupt are always re-enabled (even if
the program has not yet produced any output).
- If the 'kL' termcap entry is not available, it is taken from the
terminal descriptor's option section (del) and is no longer set to
Ctrl-X by default.
- Multiple options could not be entered using the 'set' command, fixed.
- Procedure files may now indicate explicitly the shell (or any other)
program for processing using the '#!<prog>' syntax. If a fully
qualified name is specified (e.g. #!/bin/sh) and cannot be found, the
basename is tried ('sh' in the example).
- When a signal with a number > 9 was received, an attempt was made to
execute a trap command although signals with a number > 9 could not
be trapped. This could result in bus error or other strange behavior,
fixed. Set the highest number of signals that may be trapped to 63.
- Finally, they convinced me: Shell options may now also be redefined
using Mware's '-<opt>' syntax in addition to sh's 'set -<opt>'. Note
that '-' is not (and will never be) a syntax element; it is merely
replaced by 'set -', if it is the first character in an input line and
the input line does not contain any other characters than the possible
option characters of the Mware shell. History and alias procedures are
not affected from this replacement. Added 'argsandopts' script to the
script collection. Since the cfp program now works, the 'Known
problems' paragraph could entirely be removed from the manual.
- If a procedure file has '-' as its first character, 'shell' and not
'sh' is forked for execution (same as '*').
- Fixed a conceptual problem of the '-b' test: the argument is now
expected to be the name of a device descriptor that is linked to and
whose device type is tested. If the name starts with a slash or has
a second slash, the descriptor name is extracted before linking.
Modified the related 'tests' script.
- Input buffer length of 'read <var>' command increased to 256 Byte.
- Modified 'find' script so that chd is avoided - the 'basename' tool
is very useful.
- Removed all formatted output so that a version that does not require
the cio trap handler is only about 6 kByte bigger. This cio-free version
is now part of the distribution ('sh_nocio'); it needs about 10 kByte
less static memory so that in standalone systems that normally have no
more than a single shell running the overall memory requirements can be
reduced by about 20 kByte. The cio-free version is also intended for
OS-9 3.0 systems that otherwise would not need to load the cio trap
handler into memory.
- The tilde character is now handled correctly when part of a file name
that is subjected to TAB file name completion. The tilde-slash sequence
is replaced by the current HOME directory. When tilde preceds a user's
name (e.g. '~user/') the entire expression is replaced by this user's
home directory. This behavior is equivalent to the already implemented
tilde syntax of the input line parser.
- Split 'History' paragraph from 'sh.doc' into this 'changelog' file.
#39 11/06/94
- A slash that has been added by the TAB command is now removed, if EOR
is entered immediately after the TAB file name completion.
- Added 'cQ' and 'cI' termcap entries for normal cursor and special
cursor style, respectively, to indicate whether in insert or
overwrite mode. Expanded related section in the manual.
- Added 'dirbasedemo' script to exemplify the use of the contributed
'basename' and 'dirname' programs.
- A '.sh_history' file with zero length caused problems, fixed.
- Added 'find' script that uses the strcmp program.
- Added binary programs 'basename', 'dirname', and 'strcmp' kindly
contributed by M.C. Gregorie (thanks Martin!) to the distribution.
Expanded 'Getting started' paragraph in this manual accordingly.
- If any key code entry in the termcap library uses the same character
as the current xon or xoff character, the latter is now disabled.
- Added alternate default termcap entries for Arrow-up (^P), Arrow-down
(^N), Arrow-left (^B) and Arrow-right (^F). These codes are recognized
in addition to the current termcap setting, if not used otherwise.
- Introduced default environment variables CDD (Current Data Directory
Disk Device) and CDL (Current Data Directory Level). The latter only
contains the name of the current directory level and not the entire
tree. These two variables are primarily intended to cope with OS-9 V3.0
MWOS file names when displaying them as part of the prompt. The PS1
environment variable can, for example, be set to the expression
'<$HOST/$USER/sh@>$CDD/-/$CDL:' so that the prompt no longer occupies
two third of a standard terminal input line.
- The '$`' (dollar-backquote) sequence (not a legal syntax element
anyway) caused a bus error, fixed.
- The shell variables '$:', '$.' and '$,' are now always updated before
being evaluated. Expanded related paragraph in the doc file. Added
example script 'prio'.
- Redirection to '/dev/null' is silently replaced by '/nil'.
- Renamed 'ks' and 'xs' termcap entries to 'hs' and 'hx' since the 'ks'
and 'xs' termcap codes have already been defined for other purposes and
are documented as such in the OS-9 manual .
- Added appropriate handling for 'ks' and 'xs' termcap entries (required
to enable sending of special keys on HP terminals).
#38 10/22/94
- Added alternate character to move the cursor to the end of the input
line. It is set to Cntrl-E by default, but may be redefined using the
'kA' termcap variable.
- Added 'unalias' function.
- Modified TAB file name completion: If the string is not unique and TAB
is hit a second time, the list of files is no longer inserted into the
input line but only displayed on screen. Prompt and input line are
redisplayed below this list.
- Added word-delete, uppercase, lowercase, capitalize, next-word and
previous-word commands with the default key sequences Esc-d, Esc-u,
Esc-l, Esc-c, Esc-f and Esc-b, respectively. These commands do not
set the -l option; they may, therefore, not be executed in an empty
input line (which anyway would not make sense). Termcap redefinition
strings are kX, kU, kY, kC, kF and kB, respectively.
- If any key code entry in the termcap library uses the same character as
the current keyboard quit or interrupt character, the latter is now
disabled (e.g. needed for Cntrl-E).
- Added alternate character to move the cursor to the start of the input
line. It is set to Cntrl-A by default, but may be redefined using the
'ka' termcap variable.
#37 10/20/94
- The history file '.sh_history' may now also contain LF instead of CR.
Intended for compatibility with UNIX files, e.g. if HOME is assigned to
a UNIX directory via NFS. NOTE: sh always writes CR-delimited lines.
This LF/CR remapping facility is NOT implemented for '.profile', here
files etc.
- When an input word was too long, an appropriate message was written but
sh looped endlessly - fixed.
- Input line buffer is now allocated dynamically, initial size is 2048
Byte. Every time more buffer is needed, its size is incremented by 1024
Byte. Allocated local variable space dynamically in highly recursive
functions. Added example script 'longline'.
#36 09/30/94
A nonsense pid was written, if a background process could not be
started, fixed.
<<<<<< Version 1.6, Edition 35.
>>>>>> EFFO disk released.
#35 09/19/94
Keyboard arrow codes that start with the escape character are now
possible. If at least one escaped arrow code is read from the termcap
setting, the -l option (require 'logout' to logout) is implicitly set.
Removed the related sentence from the 'Known Problems' paragraph.
#34 09/18/94
Made a number of fixes related to error handling and error output:
- Unified use of upper and lower case in error messages.
- Syntax errors and other internal errors now always cause error #1.
- OS errors let sh always return the appropriate OS error number.
- Fixed a bug in the -e=<errorfile> option execution.
#33 09/16/94
- A line that contained an undefined argument variable was not executed,
fixed.
- Shell functions appear now to be stable. Added related paragraph to the
doc file. Added example script 'funcdemo'.
- Whenever the TERM environment variable is modified, the internal
termcap settings are updated.
- Split the 'version <help>' output into several columns.
- Made 'cls' a built-in command.
- TAB file name completion even more expanded: The bell rings if an
attempt is made to expand a non-unique prefix. If under that condition
another TAB is entered, all files with matching names are inserted into
the current input line.
- TAB file name completion expanded: SPACE is appended, if valid file
name; slash is appended, if valid directory name. If the argument to
the 'chd' command ends with a slash, the slash is silently ignored.
<<<<<< Version 1.6, Edition 32.
>>>>>> EFFO disk released.
#32 08/28/94
- Long variables (>90 Bytes) could not be piped, increased pipe size to
512.
- The 'version' command may now have an argument (commands, language,
test).
- There was a strange problem with undefined shell variables and shell
arguments in conjunction with the 'test <var>' syntax, fixed.
- An empty string in the grave construct (``) caused a bus error, fixed.
- Added test function '-x' to test whether a file exists in the current
execution directory and has the execution bit set.
- Added test function '-b' to test whether the argument is an existing
'block' device, RBF/NFS (class 1), SBF (class 3), CDFM (class 5).
- Fixed a problem with the 'n>&m' I/O redirection syntax when used in
conjunction with pipes. Added a description of the 'n>&m' syntax to
the doc file. Added demo file 'mergedemo' to the collection of sh
scripts.
#31 07/23/94
- Not only space but also equal sign is now treated as start-of-filename
character for TAB file name completion. Helpful for 'copy file
-w=to_be_expanded'.
- Another step towards 100% compatibility with the Mware shell: the
exclamation mark is also accepted as pipe symbol, if not first
character of an input line and if not part of the 'test' syntax.
#30 06/12/94
- After every 'chd' command, the CWD environment variable is now updated
from RBF; this also includes correct handling of upper and lower case
characters.
- Adapted all sources so that they are accepted by GNU C 2.5.8 -
the sh binary is now about 14 kByte smaller!
#29 06/05/94
The local '.profile' file was evaluated before '/dd/sys/profile' was,
but it must be the other way round. Fixed.
<<<<<< Version 1.6, Edition 23.
>>>>>> EFFO disk released.
#28 05/20/94
- If 'cd' or 'chd' were entered twice with the same string argument, the
environment variables CWD and LWD contained the same string. This no
longer happens; LWD is only updated, if the current data directory
really changes.
- A binary program could not be executed when located in the current
execution directory and this directory was not specified at the
beginning of the PATH variable. Fixed. When a procedure file had the
execute attribute set and was specified with the fully qualified file
name, sh recursively forked itself until all available memory was
exhausted. Fixed. Added a paragraph to the doc file (see PATH
environment variable) that explains where and at what order sh is
searching for files to be executed.
- If the '#' symbol (comment symbol or stack resizer) was followed by
a new line, the next line was ignored. Fixed.
#27 05/02/94
- Finally ..., sh now expands a single name - if unique - when the TAB
key is hit. The cursor must be at the end of the input string, the
first part of the file name may have wild card or regular expression
characters. Both directory and file names may match. If there is more
than one match, the input string is expanded with the first common
characters of the matching file names.
- Clear screen is now a built-in command. Ctrl-L is defined by default
for this purpose; alternatively, the termcap entry 'kc' may be
specified. The screen is cleared, the appropriate prompt and the
current input string are written to the screen's first line.
#26 05/01/94
The content of the history buffer is now saved to $HOME/.sh_history
when sh exits and is restored when sh is restarted with the same
setting of the $HOME environment variable. To prevent the history
buffer from useless (and confusing) strings, only input from the
terminal is written to the history buffer; input from files such as
'.login' or '.profile' is no longer considered.
#25 04/19/94
Under very rare conditions, sh showed a strange behavior (failing to
execute, modifying command strings). After specifying an additional
stack space of 4 kByte, this no longer happened. Total stack size
is now about 20 kByte, static storage about 14 kByte.
#24 01/08/94
- The grave eval command didn't work, if the environment variable SHELL
was set to a shell that does not have the '-c' option. Fixed.
- The 'setstack <stack>' command now works correctly. The unit kByte is
always assumed, irrespective of whether the number is suffixed with a
'k' (upper or lower case). The same applies now to the '#' execution
modifier as well. In conclusion, 'procs #100', 'procs #100k', 'procs
#100K', and 'setstack 100; procs' behave identically. The latter,
however, permanently sets the default stack to 100 kByte.
#23 11/06/93
When sh was used as a fork shell (dsave, make etc.), or 'sh <prog>' was
entered at shell prompt level, sh's exit status was always 0,
irrespective of whether the call was successful or not. This irregular
behavior (that was also different from Mware's shell) has been fixed.
The exit status of the forked program or of the executed procedure file
is now returned.
#22 10/21/93
- The kill command can be used not only to kill a process but also to send
any other signal; the '-signal=<sig>' syntax was always available for
this purpose. The '-<sig>' syntax was added for convenience, and the
help text (sent when 'kill' is entered without arguments) expanded
accordingly.
- When 'NO CARRIER' is entered at prompt level, sh will logout. Intended
to correctly handle a situation when the carrier is lost in a modem
connection but the serial interface is not able to detect changes in the
DCD line.
#21 08/24/93
- The built-in echo function has now a usage (-?) option; in addition, the
-b option is available to suppress backslash processing (useful for
'echo $TERMCAP').
- If started non-interactively, the -x flag is set implicitly (same as
Mware shell).
- If the dot '.' is included in the PATH environment variable, (for
example .:/dd/CMDS:/dd/bin), files on the current data directory that
match the shell input string are executed (executables and procedure
file).
#20 08/03/93
Modules that have another module name than file name may now be executed
just by typing the file name (as it was always possible using Mware's
good old shell).
#19 04/17/93
- Calling sh with an argument that is a fully-qualified executable file
(e.g. 'sh /n0/host/h0/cmds/prog') now works.
- An RBF device that has not the format-inhibit flag set can be written to
using the >/device@ syntax. Very dangerous but helpful for tar output
etc.
Assumption: a person who knows the @-suffix also knows the danger of
using it for writing. Hard disks are, normally, format-protected so that
they may not be overwritten using this feature.
- The ^T (transpose) EMacs feature is now available in sh line editing
mode; helpful for lsit, laod etc.
- The SHELL environment variable is also used - and can be modified -
within the current sh session. Try 'setenv SHELL shell' prior to making
a cfp call!
#18 03/22/93
- passing a non-existing pid to kill results in a correct error message.
- 'kill abc' no longer kills process 0 but aborts with a correct error
message.
#17 02/02/93
Directory names are no longer automatically set to upper case so that
the CWD and LWD shell variables now work correctly with NFS file names
imported from UNIX hosts.
<<<<<< Edition 22.
>>>>>> Internal release.
#16 10/12/92
Maximum number of history lines increased to 1000.
Maximum number of alias definitions increased to 50.
Input string length expanded to 1024 chars.
#15 12/05/91
sh's owner is always 1.0 so that 'setuid 0.0' from a non-super user
won't work.
------------------------------------------------------------------------------