xref: /original-bsd/local/toolchest/ksh/RELEASE (revision 6cca134b)
1This is a list of changes that have been made since the 02/21/85 version
2of ksh.  A number enhancements have been made.  The rest are bug fixes.
3Many changes of the code have been made to enhance portability with certain
4compile options driven by the characteristics of the target system.
5
61.	Ksh-i now accepts eight bit character sets transparently.  Previous
7	versions used the eighth bit internally to keep track of quoting.
8
92.	The expansion for "$*" now uses the first character of the IFS parameter
10	as a separator rather than a space.  If IFS is unset or null then no
11	separator is used.  "$@" now expands correctly to "$1" "$2" ...,
12	when used as a command argument, no matter what value IFS has.
13	"${@}" and "${array[@]}" now correctly expand to no an implicit null
14	when {#@} and ${#array[@]} are zero.
15
163.	The protected mode, -p has been added to 'set' and to the shell invocation
17	line.  This sets the PATH variable to the default, disables the .profile,
18	and uses the file /etc/suid_profile instead of the ENV file.  This mode is
19	set automatically for setuid,setgid scripts.  The default path has been
20	changed to /bin:/usr/bin:.  A restricted shell now disables setting the
21	ENV parameter.
22
234.	The shell can now execute scripts which do not have read permission
24	and scripts which have the setuid and/or setgid set when they are
25	invoked by name rather than as an argument to the shell.  For this
26	feature to work, a program supplied with ksh-i named suid_exec must
27	be installed as a suid root program in /etc and ksh-i must be
28	installed in the /bin directory.
29
305.	The history file has a slightly changed format.  Old style ksh
31	history files are recognized and read correctly.  It allows eight
32	bit characters in commands and supports essentially unlimited size
33	histories.
34
356.	The HISTSIZE parameter now controls how many commands from the last
36	login session are saved.  Previously, the last 4K bytes of the history
37	file was saved across logins but since the history file stores the
38	text of functions, the number of saved commands varied.
39
407.	The shell now accepts decimal values as numerical constants when
41	performing arithmetic evaluation and truncated them.  Thus let x=2.2
42	yields x=2 rather than producing an error message.
43
448.	Options settings, set, are now atomic, i.e., they all take effect or
45	none take effect.  Previously, set -emacs caused the shell to abort
46	since -e set the error on exit, and the c option cause the set
47	command to terminate with an error.  Now this will just produce
48	an error.
49
509.	The commands echo and pwd are built into ksh-i.  Previously, they
51	were aliases.  On BSD Unix echo will behave like "print -R" if
52	echo would "whence" to /bin/echo if it were not a built-in. The
53	PWD variable is no longer readonly but will be reset by cd.
54
5510.	The -a option has been added to ulimit for BSD.  This option can
56	be used to list all current resource limits.
57
5811.	Process substitution, the ability to pass named pipes as command
59	arguments, has been documented even though it still does not work
60	on all UNIX systems since it requires the /dev/fd directory.
61
6212.	The shell now uses the LINES parameter to control printing of
63	select lists.  When possible, select tries to use about two-thirds
64	of the number of LINES.  kill -l now uses select list format with
65	numbers representing the signal number.
66
6713.	There have been a number of additions and changes to the emacs edit
68	mode.  The command M-C has been change to M-c and the command M-l
69	has been added to convert to lower case.  Several of the M- commands
70	not allow numeric parameters.  M-= has been added to list the files
71	matching the current word.  In the BSD version, the character ^Y
72	can now be used as an editing character.
73
7414.	Errors on some built-ins now cause a shell script which contains
75	them to abort.  The details as to which ones are in the manual page.
76
7715.	A shell variable SECONDS has been added which is incremented every
78	second.  Initially it is set to zero but you can assign to it to
79	reset it.  It is an integer variable.
80
8116.	The shell now prints the line number on error messages.  This should
82	aid debugging scripts.
83
8417.	The execution trace flag, -x, is no longer remains on when executing
85	shell functions.  Instead, any function which has the -t attribute
86	turned on (typeset -ft <name>), will cause the trace flag to be turned
87	on for the function <name>.
88
8918.	You can now do expansions for multi-digit positional parameters.
90	However, you must include the number in braces.  Thus, ${11} gives
91	the eleventh positional parameter and eval '$'{$#} gives the last.
92
9319.	The code has been reorganized somewhat and generates far fewer lint
94	warnings.  There is more automatic feature configuration and there
95	is a 4th generation makefile included for those who have fourth
96	generation make available.  A VFORK compile option is available
97	which causes the shell to use vfork() instead of fork() whenever
98	possible.  This is now the default mode for apollo UNIX.  The shell
99	no longer uses the segmentation violation faults internally so there
100	should be fewer "no space" messages.
101
10220.	The y and Y commands have been added to the vi-edit mode. A new command
103	= has been added which prints a select list of files matching the
104	current word. The @ command has been added to allow macro definitions.
105	Some modifications have been made to speed up screen updates at
106	slower baud rates.
107
10821.	When the shell is invoked as sh prog a path search is now performed
109	on prog.
110
11122.	There is a new command substitution syntax $(command).  The old ``
112	syntax is still supported and is completely compatible with the SVR2
113	shell.  The new syntax allows anything within () without quoting
114	since this quoting nests.  Thus, "$(" $()")" is legal and performs
115	a nested command substitution.  Any old script which has a $(
116	within "" must prepend a \ in front of the $ to make it work for
117	ksh-i.  The script will continue to run under the SVR2 shell.
118
11923.	The variable _ is set to the file name of the command exec'd in
120	the environment. Thus, any program can find its binary file whenever
121	it is invoked by the shell.
122
12324.	Bugs fixed in all versions.
124	a.	An insidious bug which, on rare occasions, caused cd to fail
125		without any indication has been fixed.  This bug only
126		occurred with certain environments.  Its only reports happened
127		in conjunction with a recursive make procedure.
128
129	b.	A shell invoked as sh -c 'program <<!
130		anything
131		! '
132		no longer gives a 'cannot open' on a temporary file.
133
134	c.	The whence command didn't work correctly when there was
135		a command in the current directory with the name of a
136		tracked alias and  the current directory came before the
137		path of the tracked alias in the path.
138
139	d.	The first argument of a for list was not always processed
140		correctly.  For example, x='*';for i in "$x";do ...;done
141		did not correctly expand $x.
142
143	e.	If a / was quoted, then file name generation did not
144		take place in some instances, for example 'dir/'* did
145		not expand.  It does this correctly now.
146
147	f.	The trackall option was inadvertently getting turned on
148		by default.  The default should be off in the interactive
149		mode
150
151	g.	The pattern */dir did not expand if * matched a directory
152		which was searchable but not readable.  As long as dir
153		doesn't contain any special pattern characters, read
154		permission is not needed for any directory matching */
155
156	h.	If an alias x='name=value command' was defined, then
157		name2=value2 x did not work correctly.
158
159	i.	Shift and . no longer leave side effects when used with
160		command substitution.
161
162	j.	The typeset command invoked with certain invalid options
163		will no longer cause the shell to dump core.
164
165	k.	If a script contains two calls to a function with both file
166		descriptor zero and one redirected, then file descriptor 1 now
167		gets restored after the second function call.
168
169	l.	Signal table names are taken from /usr/include/sys/signal.h at
170		compile time so systems that use non-standard signal numbers
171		should work OK with ksh-i.  You can now set traps on signal 11
172		since the shell no longer uses this signal internally for
173		its own stack management.
174
175	m.	A cd to a relative directory in the /etc/profile or .profile
176		before the PWD variable was set caused you to wind up in the
177		wrong directory.  This has been fixed.
178
179	n.	The ignoreeof option now ignores eof from the secondary prompt.
180
181	o.	A shell invoked as sh -c "
182		command1
183		command2
184		"
185		no longer exits after command1 completes.
186
187	p.	An r of an incomplete compound command no longer causes the
188		shell to die after the unexpected eof message.
189
190	q.	Assignments of negative numbers with let no longer result it
191		large positive numbers.  let x=-3;echo $x now yields -3.
192
193	r.	Interactive shells now work correctly the standard input is
194		a pipeline.  Previously interactive shells tried to buffer
195		standard input.
196
197	s.	In vi mode the line you are currently typing is not lost
198		if you move back in the history list.  Also, operations with
199		the last word of a line when it ended in a non-alphanumeric
200		character now works correctly.
201
202	t.	The PPID variable now works correctly no matter how a script
203		in invoked.
204
205	u.	r old=new commands now print out the command before it does
206		the execution.
207
208	v.	If a local variable within a function is exported, then
209		the local value gets passed.  Previously, the original
210		value of the value got passed in the environment.
211
212	w.	exec ksh <<!
213		!
214		no longer causes a /tmp file to be left behind.
215
216	x.	A bug which sometimes gave a "no space" message when the
217		"read" command was redirected or in a loop that was
218		re-directed has been fixed.
219
220	y.	The jobs number and process id message for background jobs
221		sometimes went to the standard output channel.  They now
222		always go to stderr.
223
224	z.	The jobs command can now be used in a pipeline.
225
226	aa.	2>&1 cmd >file is now equivalent to cmd 2>&1 >file.  In the
227		Bourne shell  and in earlier versions of ksh, the order of
228		redirection was reversed in the first form.
229
230	bb.	Open file descriptors for units above two no longer get
231		closed on exec for compound commands.  Thus, the command
232		{ command1;command2;} 7> file will no leave unit 7 open for
233		command1 and command2.
234
235	cc.	A bug in printing the ulimit on 16-bit machines has been fixed.
236
237	dd.	The command substitution `< file*` now expands when there
238		is exactly one matching file.
239
240	ee.	The shell now checks for running out of open file descriptors
241		internally and prints out a message.
242
243	ff.	The ulimit -p now gives the correct error on systems that
244		don't support this option.
245
246	gg.	Unsetting the highest element of an array, no longer causes
247		${array[*]} from producing a bad subscript error.
248