When using the ** globbing operator, bash will incorrectly add an extra
directory name when the preceding directory name ends with `*' or an empty
string when there is no preceding directory name.
If the prompt length exactly matches the screen width, and the prompt ends
with invisible characters, readline positions the cursor incorrectly.
When parsing case statements in command substitutions, the shell did not
note that a newline is a shell metacharacter and can legally be followed
by a reserved word (e.g., `esac').
When not in a locale supporting multibyte characters, readline will
occasionally not erase characters between the cursor position and the end
of the line when killing text backwards.
If a SIGWINCH arrives while bash is performing redisplay, multi-line prompts
are displayed incorrectly due to the display code being called recursively.
Using an external command as part of the DEBUG trap when job control is
enabled causes pipelines to misbehave. The problem has to do with process
groups assigned to the pipeline and terminal.
A missing include file results in an empty function definition and a no-op
when checking whether or not the window size has changed.
Adding a null line to a here-document (e.g., by hitting EOF) causes the
shell to dump core attempting to dereference the NULL pointer.
There are several problems with the handling of $LINENO in an ERR trap.
Deferring handling of signals which should cause the shell to terminate until
it is "safe" to run the handler functions does not work for some terminating
signals.
When the fc builtin is run in a command substitution from a shell with history
enabled, it does not correctly calculate the command on which to operate.
Though references to $@ when there are no positional parameters will now
cause the shell to exit if the `errexit' option has been enabled, constructs
such as ${@:-foo} should not cause an exit.
A case statement using the ;& pattern terminator followed immediately by
"esac" caused a core dump due to a null pointer dereference.
When using the new |& operator following a simple command with a redirection,
the redirection of stderr through the pipe was not performed under certain
circumstances.
mksh R38b fixes the following problems:
* [André Wösten] Add __NO_EXT_QNX to avoid picking up the wrong
waitfor() from <libutil.h> in (while porting to) QNX 6.4
* [tg] Plug memory corruption issue introduced in R38
* [tg] Amend dot.mkshrc with a base64 en-/decoder in shell
* [tg] Import a manpage fix via OpenBSD from Alan R. S. Bueno
mksh R38 comes with these changes and fixes applied:
* [tg] Improve regression test output debugging
* [tg] Fix <libutil.h> prerequisites on MidnightBSD in mirtoconf
* [tg] Mention that RedHat BZ#496791 cannot currently be fixed in the
manpage by discouraging use of apostrophes in comments in comsubs; add
appropriate (expected-fail) regression tests
* [tg] Sync with OpenBSD ksh (mostly a no-op)
* [James Butler] Add search-history-up and search-history-down keybindings
(tcsh-like) to the Emacs command line editing mode
* [tg] Bind new search-history-{up,down} to ANSI PgUp and PgDn keys
* [tg] Document ANSI default keybindings (↑↓←→ Home End Del PgUp PgDn)
in the mksh(1) manual page as well
* [tg] Optimise internal UTF-8 handling code for size and reusability
* [tg] Incompatible change: ${foo:1:2} and ${#foo} now
operate on characters, not on bytes. Characters are octets (set +U)
or (utf8-mode) MirOS OPTU-8 multibyte characters (set -U)
* [tg] Improve regression tests relating to ${foo:1:2} and
${#foo} and let wc=1#x and utf8-mode
* [tg] Use per-file copyright notices, move global text to manpage
* [tg] Expose new MKSH_MIDNIGHTBSD01ASH_COMPAT ifdef; change it to
only trigger if FPOSIX (or MKSH_BINSHREDUCED and /bin/sh)
* [tg] Remove already-dead “#if 0” style debugging code
* [tg] Change some code into a more portable fashion, optimise
* [tg] Allow [[ $foo ]] (ksh93 extension) mentioned by pgas
* [tg] Clean up mksh and the contributed arc4random.c for some
conversion, enum and other warnings for gcc-snapshot trunk r147610
* [tg] Ensure no function uses more than 768 bytes of stack either
* [tg, wbx] Add extension to make “!string” lines work like in GNU bash
Upstream changes between osh-20081213 and osh-20090527 follow:
osh bug fixes:
1) This release fixes an `echo' bug that causes `echo ""' to print an
unnecessary diagnostic.
2) It also fixes a `sigign' bug that can cause incorrect signal ignoring
behavior for subshells.
New osh features:
1) This release adds `cd' as a synonym for the `chdir' special command.
2) It also adds $m as a special parameter for the value of the MANPATH
environment variable.
.[tg] Improve præprocessor detection/work in Build.sh
.[tg] Decouple MKSH_CONSERVATIVE_FDS from MKSH_SMALL
.[tg] Enable MKSH_CONSERVATIVE_FDS by default on Minix 3
.[tg] Work around the (in-)famous ACK "const" bug
.[tg] Optimise structure alignment and padding; Closes: #522778
.[tg] Retain LOCPATH (for glibc locale) in check.pl
.[tg] Document, simplify and clean up the code better
.[tg] Use mirbsd.org eMail addresses consistently
mksh R37b comes with the following fixes on top:
.[tg] Clean up build system and dot.mkshrc some more
.[tg] Add getrusage(2) implementation using times(3) if none found
.[tg] Add jobless mode (for Minix 3, Plan 9, .)
.[tg] Detect the Amsterdam Compiler Kit in the build system
.[tg] If no RLIM_INFINITY don.t try to do ulimit
.[tg] Work around gcc4 strict warnings vs. broken system headers
.[tg] Work around systems with mmap(2) but no munmap(2)
.[tg] Fix (disallow) bind key macro recursion (instead of beeping and going into an endless loop), allow multi-line bind key macros (mostly from Alexander Hall), remove dead code (the beeping) and optimise
.[tg] Add (commented out, undesired, standards compliance breaking) compatibility code to MidnightBSD 0.1 /bin/sh for ctriv
.[tg] Clarify the mksh(1) manual page even more
.[tg] Port to Minix 3 + GCC
mksh R37 has major standards compliance improvements:
.[tg] Rename -o utf8-hack to -o utf8-mode
.[tg] Fix spacing mode error (pasto) in the mdoc(7) format manpage
.[tg] Implement $((#.)) unsigned arithmetic calculation, needed for arc4random_uniform(3)-in-korn-shell implementation
.[tg] Really preserve LD_LIBRARY_PATH in check.pl
.[tg] New Build.sh option .-combine. for building mksh(1) at once with .-fwhole-program --combine. (gcc4, llvm-gcc4) if available
.[tg] Always set COLUMNS and LINES trying as hard as we can, using TIOCGWINSZ even if used without FTALKING, and with the sane 80x24 default if the ioctl(2) fails
.[tg] Handle _POSIX_VDISABLE being undefined (e.g. Linux/klibc)
.[tg] <sys/file.h> is only required for flock(2)
.[tg] Fix multi-column output routine for the corner case if the screen is less wide than one output column; 10x Gábor Gergely
.[tg] Fix ${foo/@(%)/\\x} in UTF-8 mode (utf_widthadj for control characters U+0080.U+009F is slightly broken; this fix shifts the brokenness into the command line editing mode only)
.[tg] Introduce mksh_ari_t and mksh_uari_t internal types to limit arithmetics to 32 bit on all systems; currently depending on the already-used standard int32_t and uint32_t types. Future expansion to 64 bit possible. Document that shell integer variables use this type.
.[tg] The variables PGRP, PPID, RANDOM and USER_ID are now unsigned
.[tg] Fix two off-by-ones breaking PS1 ending with a newline; bug reported by Matthias Diener
.[tg] Just pass through C1 control characters for now
.[tg] Code and internal interfaces cleanup
.[tg] Regression test fixes for Cygwin env(1) being unsorted
.[tg] Replace the memory allocator by something equally simple and homegrown but optimised for use with mksh and free checking
.[tg] Import a couple of minor fixes (e.g. spelling) from oksh
.[tg] Fix problems with "set -e" for real; from oksh, Closes: #518359
.[tg] In "set -o posix" mode, have limited echo(1) to improve standards compliance; the exact feature set is open for discussion, e.g. with pkgsrc® people; for now, only -n as first arg
.[tg] Make test builtin operator precedence consistent; from oksh
.[tg] Revamp and fold and enhance the regression tests
.[tg] Document somewhat surprising behaviour in mksh(1) better; here: [ x -eq y ]; for gps23 from #ksh
.[tg] Reduce memory consumption by allocator simplification
.[tg] Fix bugs spotted by DEC ucode cc (ULTRIX) and gcc 1.42 (BSD/OS)
.[laffer1] Make mksh the default /bin/sh in MidnightBSD
quite simply using a configuration file. It becomes easy to restrict user's
access to a limited set of commands, chosing to allow any command over SSH
(e.g. SCP,SFTP,rsync,etc.).
OK'd by seb@
Since two people already asked for it, here's the package, but
maintainer is set to pkgsrc-users.
Bash is an sh-compatible shell that incorporates useful features from
the Korn shell (ksh) and C shell (csh). It is intended to conform to
the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard.
It offers functional improvements over sh for both programming and
interactive use; these include command line editing, unlimited size
command history, job control, shell functions and aliases, indexed
arrays of unlimited size, and integer arithmetic in any base from two
to sixty-four. In addition, most sh scripts can be run by Bash without
modification.
This package contains the outdated version 3 of bash.
1. New Features in Bash
a. When using substring expansion on the positional parameters, a starting
index of 0 now causes $0 to be prefixed to the list.
b. The `help' builtin now prints its columns with entries sorted vertically
rather than horizontally.
c. There is a new variable, $BASHPID, which always returns the process id of
the current shell.
d. There is a new `autocd' option that, when enabled, causes bash to attempt
to `cd' to a directory name that is supplied as the first word of a
simple command.
e. There is a new `checkjobs' option that causes the shell to check for and
report any running or stopped jobs at exit.
f. The programmable completion code exports a new COMP_TYPE variable, set to
a character describing the type of completion being attempted.
g. The programmable completion code exports a new COMP_KEY variable, set to
the character that caused the completion to be invoked (e.g., TAB).
h. If creation of a child process fails due to insufficient resources, bash
will try again several times before reporting failure.
i. The programmable completion code now uses the same set of characters as
readline when breaking the command line into a list of words.
j. The block multiplier for the ulimit -c and -f options is now 512 when in
Posix mode, as Posix specifies.
k. Changed the behavior of the read builtin to save any partial input received
in the specified variable when the read builtin times out. This also
results in variables specified as arguments to read to be set to the empty
string when there is no input available. When the read builtin times out,
it returns an exit status greater than 128.
l. The shell now has the notion of a `compatibility level', controlled by
new variables settable by `shopt'. Setting this variable currently
restores the bash-3.1 behavior when processing quoted strings on the rhs
of the `=~' operator to the `[[' command.
m. The `ulimit' builtin now has new -b (socket buffer size) and -T (number
of threads) options.
n. The -p option to `declare' now displays all variable values and attributes
(or function values and attributes if used with -f).
o. There is a new `compopt' builtin that allows completion functions to modify
completion options for existing completions or the completion currently
being executed.
p. The `read' builtin has a new -i option which inserts text into the reply
buffer when using readline.
q. A new `-E' option to the complete builtin allows control of the default
behavior for completion on an empty line.
r. There is now limited support for completing command name words containing
globbing characters.
s. Changed format of internal help documentation for all builtins to roughly
follow man page format.
t. The `help' builtin now has a new -d option, to display a short description,
and a -m option, to print help information in a man page-like format.
u. There is a new `mapfile' builtin to populate an array with lines from a
given file. The name `readarray' is a synonym.
v. If a command is not found, the shell attempts to execute a shell function
named `command_not_found_handle', supplying the command words as the
function arguments.
w. There is a new shell option: `globstar'. When enabled, the globbing code
treats `**' specially -- it matches all directories (and files within
them, when appropriate) recursively.
x. There is a new shell option: `dirspell'. When enabled, the filename
completion code performs spelling correction on directory names during
completion.
y. The `-t' option to the `read' builtin now supports fractional timeout
values.
z. Brace expansion now allows zero-padding of expanded numeric values and
will add the proper number of zeroes to make sure all values contain the
same number of digits.
aa. There is a new bash-specific bindable readline function: `dabbrev-expand'.
It uses menu completion on a set of words taken from the history list.
bb. The command assigned to a key sequence with `bind -x' now sets two new
variables in the environment of the executed command: READLINE_LINE_BUFFER
and READLINE_POINT. The command can change the current readline line
and cursor position by modifying READLINE_LINE_BUFFER and READLINE_POINT,
respectively.
cc. There is a new &>> redirection operator, which appends the standard output
and standard error to the named file.
dd. The parser now understands `|&' as a synonym for `2>&1 |', which redirects
the standard error for a command through a pipe.
ee. The new `;&' case statement action list terminator causes execution to
continue with the action associated with the next pattern in the
statement rather than terminating the command.
ff. The new `;;&' case statement action list terminator causes the shell to
test the next set of patterns after completing execution of the current
action, rather than terminating the command.
gg. The shell understands a new variable: PROMPT_DIRTRIM. When set to an
integer value greater than zero, prompt expansion of \w and \W will
retain only that number of trailing pathname components and replace
the intervening characters with `...'.
hh. There are new case-modifying word expansions: uppercase (^[^]) and
lowercase (,[,]). They can work on either the first character or
array element, or globally. They accept an optional shell pattern
that determines which characters to modify. There is an optionally-
configured feature to include capitalization operators.
ii. The shell provides associative array variables, with the appropriate
support to create, delete, assign values to, and expand them.
jj. The `declare' builtin now has new -l (convert value to lowercase upon
assignment) and -u (convert value to uppercase upon assignment) options.
There is an optionally-configurable -c option to capitalize a value at
assignment.
kk. There is a new `coproc' reserved word that specifies a coprocess: an
asynchronous command run with two pipes connected to the creating shell.
Coprocs can be named. The input and output file descriptors and the
PID of the coprocess are available to the calling shell in variables
with coproc-specific names.
ll. A value of 0 for the -t option to `read' now returns success if there is
input available to be read from the specified file descriptor.
mm. CDPATH and GLOBIGNORE are ignored when the shell is running in privileged
mode.
nn. New bindable readline functions shell-forward-word and shell-backward-word,
which move forward and backward words delimited by shell metacharacters
and honor shell quoting.
oo. New bindable readline functions shell-backward-kill-word and shell-kill-word
which kill words backward and forward, but use the same word boundaries
as shell-forward-word and shell-backward-word.
2. New Features in Readline
a. A new variable, rl_sort_completion_matches; allows applications to inhibit
match list sorting (but beware: some things don't work right if
applications do this).
b. A new variable, rl_completion_invoking_key; allows applications to discover
the key that invoked rl_complete or rl_menu_complete.
c. The functions rl_block_sigint and rl_release_sigint are now public and
available to calling applications who want to protect critical sections
(like redisplay).
d. The functions rl_save_state and rl_restore_state are now public and
available to calling applications; documented rest of readline's state
flag values.
e. A new user-settable variable, `history-size', allows setting the maximum
number of entries in the history list.
f. There is a new implementation of menu completion, with several improvements
over the old; the most notable improvement is a better `completions
browsing' mode.
g. The menu completion code now uses the rl_menu_completion_entry_function
variable, allowing applications to provide their own menu completion
generators.
h. There is support for replacing a prefix of a pathname with a `...' when
displaying possible completions. This is controllable by setting the
`completion-prefix-display-length' variable. Matches with a common prefix
longer than this value have the common prefix replaced with `...'.
i. There is a new `revert-all-at-newline' variable. If enabled, readline will
undo all outstanding changes to all history lines when `accept-line' is
executed.
j. If the kernel supports it, readline displays special characters
corresponding to a keyboard-generated signal when the signal is received.
Changes from NEWS:
--------8<--------8<--------8<--------8<--------8<--------8<--------8<
Major changes between versions 4.3.6 and 4.3.9
----------------------------------------------
The option COMBINING_CHARS has been added. When it is set, the
line editor assumes the terminal is capable of displaying zero-width
combining characters (typically accents) correctly as modifications
to the base character, and will act accordingly. Note it is not set
by default owing to vagaries of terminals. The system is reported
to work on MacOS, where this is particularly important as accented
characters in file names are stored in their decomposed form (i.e.
with base and combining characters).
The option HIST_FCNTL_LOCK has been added to provide locking of history
files using the system call fcntl(). On recent NFS implementations this
may provide better reliability.
The syntax ~[...] provides a dynamic form of directory naming,
supplementing the existing static ~name syntax. A user-defined shell
function, zsh_directory_name, is used to handle both expansion of names to
directories and contraction of directories to names.
Patterns can now be used in incremental searches with the new widgets
history-incremental-pattern-search-backward and
history-incremental-pattern-search-forward. These are not bound to
keys by default.
Highlighting and colouring of sections of the command line is now
supported, controlled by the array parameter zle_highlight and the ZLE
special parameter region_highlight.
Colouring of prompts is now supported within the shell by prompt
escapes. The prompt theme system has been updated.
Various changes have been added to make debugging of shell code easier:
- As noted in README, the option DEBUG_BEFORE_CMD is now set by default.
- In DEBUG traps, $ZSH_DEBUG_CMD gives the code for which the trap is
called as a string.
- "setopt ERR_EXIT" in a DEBUG trap causes the code not to be executed.
- $ZSH_SUBSHELL indicates the subshell level at which code is being
executed.
- The zsh/parameter module has various additional arrays similar to
the existing $funcstack and $functrace, namely $funcsourcetrace
and $funcfiletrace. The consistency and informativeness of
the output of all these arrays has been improved.
- Prompt escapes %x and %I show the source file and line number in
debug prompts (compare %N and %i which show names and line numbers
in the execution environment).
- The option NO_MULTI_FUNCDEF can turn off multiple definition of
functions at once, a rarely used feature that can cause problems
with misplaced "()".
- The "fc" builtin has been enhanced to make non-interactive use possible
and output consistent when the history is manipulated with "print -s".
The completion style accept-exact-dirs has been added. When true, this
suppresses attempts to complete non-final directory segments of a filename
path when the directory exists. (For example, /home/pws/src/zsh/<TAB>
discovers that /home/pws/src/zsh exists and leaves the directory component
alone, while /h/p/s/z/<TAB> completes to /home/pws/src/zsh/... as before.)
This should improve completion behaviour noticeably in special cases, such
as remote paths under Cygwin.
Major changes between versions 4.3.5 and 4.3.6
----------------------------------------------
cd, chdir, pushd and popd now take a -q option to suppress side effects
including printing the directory stack (for pushd and popd) and executing
the chpwd hook functions (for all four).
The parameter subscript (e) flag now forces the argument to be treated
as a string where it would previously have been treated as a pattern,
for example ${array[(ie)*]} substitutes the index of the element whose
value is "*".
Major changes between versions 4.3.4 and 4.3.5
----------------------------------------------
- The new extended globbing flag (#cN,M) behaves similarly to the extended
regular expression syntax {N,M}.
- The zsh/datetime module has been enhanced and a calendar function
system has been added along the lines of (but much enhanced from)
the traditional Unix "calendar" utility. This is still under
development. See the zshcalsys manual. (The calendar functions
were in 4.3.4 but were not listed in this file. There have been
significant enhancements since 4.3.4.)
- A new module zsh/curses provides a builtin zcurses for access to
to the curses screen manipulation package. See the entry for zsh/curses
in the zshmodules manual.
- The module system has been enhanced to support the notion of "features"
that give more control over which builtins, parameters, conditions
and math functions are loaded from a module. In particular,
"zmodload -F zsh/stat b:zstat" makes the builtin previously called
"stat" available as "zstat" (only) to avoid clashes with a system
command named "stat".
>8-------->8-------->8-------->8-------->8-------->8-------->8--------
Upstream changes between osh-20081122 and osh-20081213 follow.
osh.c:
This release changes the effect of the `-v' command-line option so that,
in addition to printing non-blank command lines to the standard error,
it also prints each blank/empty command line as an empty line.
fd2.c, util.c:
This release changes the fd2 `-e' command-line option so that it
reflects the documented behavior. For example, this change causes
invocation of `fd2 -ef file command' to redirect both conventional
output and diagnostic output from "command" to "file".
Add new maintainer. Thank you J.A.
The following is from PR #40006:
I would like to maintain this package if that is acceptable.
Thus, I added myself as MAINTAINER.
Changed files: DESCR, Makefile, PLIST, distinfo
Changes between osh-20080629 and osh-20081122 which affect the osh
package on the various pkgsrc platforms are described below.
------------------------------------------------------------------------
[osh-20081122]:
mkconfig:
* Added a case for DragonFly BSD (uname -s == DragonFly).
osh.c:
* Fixed a bug introduced in osh-20061230 where the shell
incorrectly handles an unescaped terminating backslash (\)
character at the end of string when the shell is invoked as
`osh -c string'. In this case, the terminating backslash
causes the shell to incorrectly read from the standard input
at the end of string.
For example:
% osh -c 'echo Hello\'
to\
you!
Hello to you!
This example should instead do nothing and exit w/ a zero
status. For `osh -c string', an unescaped terminating
backslash should effectively turn string into a no-op.
Now, it behaves as expected.
------------------------------------------------------------------------
[osh-20081026]:
Makefile:
* Changed the "oshall" target to only build osh since the fd2,
goto, and if utilities are now built into the shell.
* Changed the "install-oshall" target to only install osh and
its manual pages. This includes the fd2.1, goto.1, and if.1
manual pages since they are not fully documented elsewhere.
osh.c:
* Renamed cmd_index() to cmd_lookup(), and changed the algorithm
from a linear search to a binary search.
* Added a base reallocation multiplier to glob() to reduce the
number of realloc()s required for very large argument vectors
while allowing the first malloc() to be a relatively small
allocation for up to 126 matching file-name arguments.
util.c:
* This is a new file for the integrated shell utilities.
* Added a new `-e' command-line option to fd2 to simplify
redirecting all conventional output to the standard error
as diagnostic output.
* Integrated the external `fd2', `goto', and `if' shell
utilities as special built-in commands to improve shell
performance. Also, added `echo' as a special built-in
command. Osh executes each of these built-ins in a subshell.
Consequently, the I/O for each can be redirected as before,
and the argument list for each can be the result of a call to
glob() as before.
Major changes:
* Digital UNIX (DEC OSF/1) V2.0 (MIPS) is now supported using the DEC C and ucode toolchain. (We could not run the testsuite, though.)
* The ‘-Q’ option to Build.sh is gone without replacement.
* A new option can be enabled by adding -DMKSH_BINSHREDUCED to $CPPFLAGS, intended mostly for Debian. This option adds extra code to determine whether mksh(1) is called as sh or -sh and switch to “set -o posix” mode if so, disabling brace expansion and some security features, because legacy scripts, such as debconf, depend on such reduced functionality /bin/shs.
* Input lines beginning with an IFS character of IFS white space are no longer pushed into the history. Some other, less surprising, changes were also made to both Emacs and Vi command line editing modes.
* The arc4random.c contributed file is now stored with the RCS version number appended, and has been updated.
to trigger/signal a rebuild for the transition 5.8.8 -> 5.10.0.
The list of packages is computed by finding all packages which end
up having either of PERL5_USE_PACKLIST, BUILDLINK_API_DEPENDS.perl,
or PERL5_PACKLIST defined in their make setup (tested via
"make show-vars VARNAMES=...").
mksh R35b comes with the following bug fixes:
IRIX also has no UTF-8 locale at all, confirmed by Elias Pipping
Fix regression test suite for MKSH_SMALL
Bring in latest changes from oksh (OpenBSD ksh, not DeliLinux crap)
Fix abuse and unsafe use of str_save() and str_nsave()
Optimise the implementations of str_save() and str_nsave()
If MKSH_AFREE_DEBUG is defined, guard against afree()ing a pointer which has not been allocated from the given pool, from Todd C. Miller
Fix attempt to free a pointer to stack (function-local) storage when redefining a function containing a call to the “time” built-in, discovered by Elias Pipping, patch by Jared Yanovich, help from Todd C. Miller
Protect a little against people not running “./test.sh -v” but calling it with, for instance, GNU bash (as homsn did…)
Honour $PERL environment variable in test.sh, improve scanning for Perl, do not use potentially undefined $^O, print Perl version
Add <sys/types.h> as <ulimit.h> requirement (dietlibc)
Work around bug in BSD/OS 3.1 /bin/ksh (PD KSH v5.2.8 96/08/19)
Add regression tests from OpenBSD’s <bsd.regress.mk> suite
Use better CPPFLAGS for AIX, Minix 3 (from pdksh)
Expose the “s ≠ NULL” str_[n]save_() API and use it where the string can never be NULL (local stack storage), from gcc-4.2 warnings
Clean up pointer-to-integer-cast warnings in the mirtoconf process
mksh R35 comes with helluva changes:
Simplify and refactor the ulimit builtin, partially from oksh
Some style cleanup; use appropriate integer types
Fix a bug in table (e.g. kill -l, tab completion) display: the width of non-ASCII characters is now honoured in the utf8-hack mode
Improve handling of invalid UTF-8 in certain areas, and multibyte (UTF-8 / CESU-8) in general
When using “typeset -Z«n»” on an integer variable with a base other than ten, zero-pad the value instead of the base – pdksh, oksh, zsh, and AT&T ksh93 are wrong here; GNU bash doesn’t even have typeset
Improve parsing of “set +o” output where done (dot.mkshrc, check.t)
Improve regression tests
Support for base-1 numbers: in non-utf8-hack mode, ‘1#x’ means the same as the ASCII code for ‘x’ (e.g. 78hex), where ‘x’ is any single octet (byte); in utf8-hack mode, ‘x’ is either a valid and minimalistically encoded UTF-8 multibyte character in the range 0000‥FFFD, or a single octet with no trailing octets (bytes), which will then be converted as if it were an ASCII value, or, if bit7 is set, be mapped into the PUA range of EF80‥EFFF assigned by CSUR for this purpose; this mapping is, in both cases, bidirectional; the planned base-0 number support is not possible with the code, so use base-1 (with utf8-hack disabled, or & 0xFF) instead (while it is recommended to parse only single octets, there is a regression test showing correct and safe multibyte parsing, which however is error-prone to implement and thusly not recommended) – “genial” replaced@TNG, “this sounds fun” ggergely, agreed bsiegert@ and others
Pull in more current versions of supplied files; use Unicode 5.0
Clean up unused definitions in build system; document MKSH_CLS_STRING
Remove advertising clause from copyright file; while we’d be pleased to be mentioned if something contains our code, tg@ will no longer enforce the requirement to advertise with that specific formula, and we’d prefer if people remember the OpenHAL vs ath5k incident and that they cannot simply change licencing of existing code; patches sent to the MirOS Project for inclusion shall be accepted if they’re agreed to match this licence
Simplify dot.mkshrc sample file: licence is merged into the main copyright file; AT&T ksh93 compatibility was improved
Fix a display problem regarding fullwidth characters (e.g. CJK)
Set the “C” locale in Build.sh for tool execution; otherwise, certain OEs behave strange; thanks to Adam “replaced” Hoka for spotting
Use en_US.utf8 as UTF-8 locale for the testsuite for now
If setlocale(LC_CTYPE, "") is not available, look at the environment variables ourselves – brings UTF-8 support to poor OSes
Remove some now-dead code; speed up configuration process; shrink
Default to no setlocale(3) due to stubbed or missing locale support on GNU/Cygwin, OpenBSD, OSF/1 in Build.sh; a few more that are quite unlikely to have a UTF-8 locale: BSD/OS, Interix, Minix, PW32, Ultrix, AT&T UWIN; default to always UTF-8 on Plan 9
Fix for testsuite unexpected failure if running as root in one case
Initialise all shell integer variables (OPTIND, PPID, RANDOM, SECONDS, TMOUT) to base 10
Reintroduce from mksh pre-R24 shell integer variable PGRP set to the PID of the process group leader via getpgrp(2)
New shell integer variable USER_ID set to the geteuid(2) and used by dot.mkshrc to speed up logins, saves a spawn of id(1), mentioned by and realisation planned with Andreas "gecko2" Gockel
Fix dot.mkshrc tilde replacement in both $PS1 and the pushd/popd/dirs implementation when the home directory is empty, the root directory, or ends with a slash (disable replacement in that case)
Support dietlibc, force it into providing a BSDish caddr_t
Do not use LDFLAGS and LIBS while compiling with -c
Add realpath(3) builtin, to further speed up logins and chdirs
Optimise the code somewhat by making use of possible assumptions
Set the “C” locale in test.sh as well to quell warnings
Split the regression tests that use locale between en_US.utf8 and en_US.UTF-8, since not all OSes support either one, and make only HP-UX and GNU use the latter
Fix kill, mknod(8) builtin usage msg, from Igor Sobrado via oksh
Use proper ptrdiff_t casts for pointer arithmetics, inspired by an oksh commit from Federico Schwindt
Remove check category “pdksh” from check.t and test script
Improve Darwin, OSF/1, HP aCC, SUNpro version reporting
Support GNU bash “&>” extension, even better than they do, suggested by Lukas “smultron” Upton from MidnightBSD
Basic support for LLVM+clang in the build system with experimental “ccc” compiler driver; llvm-gcc worked as-is before already
Better support for contributed arc4random.c file
Do not spin if unlink(2) fails on $HISTFILE, from Decklin Foster
Dump the perl(1) $^O variable in test.sh to logs
Pull in latest changes from oksh
Allow white space between a here string indicator and the string, accidentally discovered by twkm (#ksh, freenode)
Allow fd specifications outside the 0‥9 range for I/O redirections, and bounds check them to be lower than the FDBASE definition, currently still 10 if MKSH_SMALL, 24 otherwise (unportable)
Improve the regression test suite: for one test, we had a bizarre constraint telling it won’t work on UWIN, which was based upon false assumptions, but Tru64 would fail it since its cat(1) unexpectedly outputs some error messages (fix by closing stderr for cat); another test would unexpectedly print no error message on Solaris (fix by making the error message optional in the perlre(1) used)
Switch back to en_US.UTF-8 for glibc, Debian can do both, Mandriva fails on en_US.utf8 (XXX no libc5 auto-detection to disable it)
Based on PR 37283 (update to 1.8).
eltclsh 1.9 released august 8, 2008
30. Fix libtool usage and install target to allow cross compilation in OpenEmbedded.
29. Honor TCL_DBGX to allow compiling against a tcl library with debugging
symbols enabled.
28. Honor CFLAGS from the environment during the build process
27. Fix history command that was not working.
26. Switch repository to git.
eltclsh 1.8 released august 20, 2007
25. Add wrappedputs procedure that print a string wrapped to a given width.
24. Stop scanning arguments in interactive mode when user press C-d.
eltclsh 1.7 released december 19, 2006
23. Add new function "interactive" which starts the interactive
interpreter (useful inside scripts).
22. Add support for installation in $(DESTDIR)
Based on PR 37283 (updated to 1.8).
eltclsh 1.9 released august 8, 2008
30. Fix libtool usage and install target to allow cross compilation in OpenEmbedded.
29. Honor TCL_DBGX to allow compiling against a tcl library with debugging
symbols enabled.
28. Honor CFLAGS from the environment during the build process
27. Fix history command that was not working.
26. Switch repository to git.
eltclsh 1.8 released august 20, 2007
25. Add wrappedputs procedure that print a string wrapped to a given width.
24. Stop scanning arguments in interactive mode when user press C-d.
eltclsh 1.7 released december 19, 2006
23. Add new function "interactive" which starts the interactive
interpreter (useful inside scripts).
22. Add support for installation in $(DESTDIR)
Significant changes include the following:
1) Support was added for 3 new command-line options: "-i", "-l", and "-v".
2) Support was added for 3 new rc files.
*) This includes a system-wide "osh.oshrc",
a system-wide "osh.logout", and a user ".osh.logout".
See http://v6shell.org/src/CHANGES for full details.
PDKSH-5_2_14 and NetBSD-current HEAD as of 2008-05-31.
- Fixes rare segfault seen on Solaris.
- add strlcpy and strlcat fallback implementations from libnbcompat
- regenerate configure (using autoconf-2.12, ugh)
Changes since 4.3:
- fix support for quota and passwd when running within the
chroot (exec pre-chroot)
- disallow rsync and svnserve from being run as daemons that
listen on a port
- switch to getopt_long for command processing, use getopt for
sftp-server, svnserve, and quota
- abort processing on commands that require getopt when getopt
is not available
- switched to slightly optimized and more compact debug code
- fix unison support within chroots
- fix for unison command execution bug
- allow multiple users with the same uid using USER environment
variable
- added missing semicolon to helper.c
- fixes the configure.in script to not define HAVE_OPTRESET, not
even to a value of 0
- fixes that hopefully improve the optarg compilation situation
- UNISON $HOME environment fix
- fixes to setup_chroot.sh/in
No changes in mksh R33c except for Ultrix support. None in R33d.
In mksh R33b, much more compilers are detected, even if not all of
them are supported. The OE (OS and CC/LD) versions are now dumped
too. Instead of #error, forced link failures are now used as the
mechanism to auto-detect some things in the target environment.
Features are now much better detected, and some annoying warnings
don't show up any longer due to this. Less tools are required to
build.
Please be reminded that you should run ./test.sh -v inside an
environment with /dev/tty available (as device node) and usable
(e.g. use script(1) or GNU screen if you're doing auto-builds
detached from controlling terminal). Use -v to see failures.
No surprises in mksh R33 either, but the build system now gives
more detailed output on the version actually built, to aid tracking
down FTBFSen (build errors) with access to only the build logs.
Regression tests now work with Intel's compiler on SLES too, which
requires a custom LD_LIBRARY_PATH formerly stripped by the script.
A relatively new feature in bash is programmable completion, which
has been available since the beta version of 2.04. Programmable
completion will be familiar to you if you are a zsh user. It also
exists, albeit in a much less usable form, in tcsh.
Standard completion
bash has offered many forms of completion since its inception,
including path, file, user, host and variable completion.
* Path-name completion
* File-name completion
* User-name completion
* Host-name completion
* Variable-name completion
Programmable completion indefinitely extends the type of completion
you can perform.
This package contains a variety of completions for various programs.
Based on patch provided by Jeffrey Allen Neitzel in PR 37737.
My modification:
* Honor PKGMANDIR
* Update MASTER_SITES and HOMEPAGE to new location.
Changes:
[osh-20080109]:
* New file: mkconfig (see Build/Install Changes)
* Moved files: Moved manual pages from *.1 to *.1.in to make their
generation and installation simpler in the Makefile.
Build/Install Changes:
* Stopped defining _XOPEN_SOURCE when compiling on Mac OS X, NetBSD,
and OpenBSD. It is simply not necessary. However, _XOPEN_SOURCE
and _BSD_SOURCE are necessary on GNU/Linux systems.
* Added a simple configure script, mkconfig. It is automatically
invoked from the Makefile to write out an appropriate "config.h"
file according to the osh package's needs on the given system. It
simply sets PATH_LOGIN, PATH_NEWGRP, _XOPEN_SOURCE, and _BSD_SOURCE
as needed so that the user does not need to bother w/ doing it
manually at build time.
osh.c:
* Patched the code to fix a "$0" parameter-substitution problem w/
the `source' command in the following interactive context:
% cat >file
echo \$0 == \"$0\"
echo \$1 == \"$1\"
^D
% source file ; : ... gives correct value for "$0".
$0 == ""
$1 == ""
% source file arg ; : ... gives incorrect value for "$0".
$0 == "0"
$1 == "arg"
getdolp() indirectly caused the problem by returning a NULL pointer
when the intended result was a pointer to the empty string. This
problem was not fatal, as the shell handles NULL pointers from
getdolp() anyway. However, NULL is supposed to indicate an
error where the specified parameter means nothing to the shell...
For example:
% echo \$Z == \"$Z\"
$Z == "Z"
* Changed the source command's parameter-substitution behavior so
that $0 always results in the name of the sourced command file,
not the name inherited from the main shell context. This makes
the parameter-substitution behavior of sourced command files
just like that of any other osh command file. Plus, this is
the documented behavior.
osh.1.in, sh6.1.in:
* Revised some wording to remove some cases of possible ambiguity.
-------------------------------------------------------------------------------
[osh-20070707]:
* Added a new file, INSTALL, which contains build and install
instructions. Made reference to INSTALL in Makefile and README.
Makefile:
* Added 3 new variables, MOXARCH, MOXSHELLARCH, and MOXUTILSARCH, to
simplify building universal binaries for Mac OS X. These are unset
by default. See INSTALL for more info.
* Changed the default value for SYSCONFDIR from /etc to $(PREFIX)/etc.
osh.c:
* Changed the reserved file descriptors from (7 - 9) to (10 - 12) in
order to avoid fd conflict w/ rxvt-unicode (version 8.2). This
conflict prevented `chdir -' from functioning correctly, but this
problem is now fixed.
The problem was clearly visible when running an interactive instance
of osh under the rxvt-unicode daemon (urxvtd) on Mac OS X. However,
I never saw this type of conflict when running under any other type
of terminal emulator on any OS. Thus, I do not know if this was
only an osh problem, a urxvtd problem, a Mac OS X problem, or some
combination of the 3...
R32:
* Make checks for symbol declarations compile checks instead of link
checks, as the binding may not succeed due to different symbol types,
for instance on AIX, if the declaration does not match
* Widen the range of array indices to [0..2^3ý-1], with negative values
being mapped into the high-bit31 range for simplicity
* Fix the pipeline-as-coprocess internal error
* Do not require certain integer types to be defined any more
R31d:
* Support pcc (the ragge version of the Portable C Compiler)
* Add pushd/popd/dirs functions (csh) and precmd/chpwd hooks (zsh) to
dot.mkshrc which now requires readlink(1) with -f; requested by many
(e.g. some Gentoo users; XTaran of symlink.ch)
* Enable colour escapes in dot.mkshrc since almost nobody groks how to
do it right from the manual
* Remove -DMKSH_NEED_MKNOD checks from Build.sh, people should use the
HAVE_MKNOD environment variable
* Implement parallel make in Build.sh
* Fix another busy-loop spinning problem introduced by an icc warning,
thanks to spaetzle@freewrt.org for keeping to bug me to look for it,
as it affected GNU/Linux most, followed by Solaris, rarely BSD
* Improve standard integer type detection in Build.sh
* Cleanups in code, build script and manual page
R31b:
* Fix typo (blsk -> bksl) in check.t test naming
* Autoscan for uint32_t, u_int etc. presence
* Fix some memory leaks, mostly by NetBSD(R) via OpenBSD
* The "unset" builtin always returns zero, even if the variable was
already unset, as per SUSv3 (reported by Arkadiusz Miskiewicz via
pld-linux -> oksh)
* In tab-completion, escape the question mark, reminded by
cbiere@netbsd.org, via oksh
* Fix a busy-loop problem, Debian #296446 via oksh
* Fix a few display output problems in the build script
* Shut up some gcc warnings on Fedora; beautify some code
* Support OSF/1 with gcc2.8, thanks to Jupp Schugt
* Fix gcc4 detection of __attribute__() on non-SSP targets
R31:
* Support the TenDRA compiler (possibly also Ten15, not tried)
* Begin supporting Fabrice Bellard's Tiny C Compiler (tcc on Debian
cannot link due to duplicate symbols in GNU libc, thus unfinished)
* Improve some mirtoconf checks (most notably, mknod(2) and macros)
* Add new emacs editing command "clear-screen" (ESC ^L) as requested by
D. Adam Karim <archite@midnightbsd.org>
* Support building for MidnightBSD
* Add new shell alias "source", semantics like the GNU bash builtin
* Add new shell option "set ño arc4random", controlling whether rand(3)
or arc4random(3) is used for the $RANDOM value, use
arc4random_pushb(3)
* Add new builtin "rename" (just calls rename(2) on its arguments)
* Fix the inofficial OpenBSD port, from D. Adam "Archite" Karim, 10x
* Disable the less(1) history file by default (privacy issues) in the
sample dot.mkshrc file; mention other things in etc_profile
* Fix a syntax error in Build.sh checking for TenDRA
linking behavior under NetBSD. This matches what "bsd.shlib.mk" does
and avoids "Malformed conditional" warnings under other platforms.
This fixes PR pkg/36769 by Yakovetsky Vladimir.
* If the basename of argv[0] starts with "sh", activate FPOSIX early,
preventing some typical ksh aliases from being defined.
* If FPOSIX, don't pre-define aliases (except integer and local) to
benefit operating environments that never heard of the great Korn Shell.
* Support x=(a b c) bash-like array initialisation
* Support ${foo:2:3} bash-like substring expansion
* Don't try to execute ELF, a.out, COFF, gzip or MZ binaries, e.g.
mksh /bin/sh.
* Prefer well-known signal names to alphabetically earlier ones
* Fix a bug delivering ERR and EXIT pseudo-signals to traps combined
with "set -e".
Update from mirabilos#pkgsrc with small fixups by me.
developer.
pkgsrc changes include:
Use BUILD_TARGET=oshall as request in PR.
And make it work with PKGMANDIR.
CHANGES file includes:
Changes that improve compatibility w/ the Sixth Edition Unix shell
are marked w/ a `C:' in the details below.
-------------------------------------------------------------------------------
[osh-20070324]:
osh.c:
* In main(), changed when fdfree() is called so that it is in a more
ideal sequence with other operations according to how the shell is
invoked (e.g., interactive shell vs. non-interactive shell).
-------------------------------------------------------------------------------
[osh-20070321]:
* Imported the project into a local subversion repository.
* Changed the all of the code to "#include <stdbool.h>" and to use
the "bool" data-type macro where appropriate.
Makefile:
* Added SYSCONFDIR and a new `man' target.
osh.c:
* Defined _PATH_SYSTEM_LOGIN as `SYSCONFDIR/**/"/osh.login"' instead
of "/etc/osh.login" so that the user can use SYSCONFDIR (/etc by
default) at build-time to specify the directory where the shell
shall search for its system-wide initialization file.
* Added a new special parameter, $v, which makes the version of the
osh package available as a read-only string. The format is
`osh-YYYYMMDD' for official releases and `osh-current (YYYYMMDD)'
(interpreted as one word) for development snapshots.
* Fixed a bug where interactive shells were no longer ignoring SIGTERM
when invoked, as they are supposed to. Now, SIGTERM is being ignored
again upon invocation of all interactive shells.
* Fixed the output from doing a `sigign' so that it matches its
documentation in osh.1: "..., a list is printed of those signals
which are ignored by sigign in the current shell."
Previously, the output from a `sigign' could be a little confusing.
Now, its output only indicates those cases where a given signal is
being ignored w/ the possibility that it can then be unignored
(reset) in the current shell context.
if.c:
* Added 3 new primaries: -ef (equal files - same device, same inode),
-nt (newer than), -ot (older than). See the if(1) manual page for
full details.
-------------------------------------------------------------------------------
[osh-20070131]:
osh.1:
* Made a few minimal changes to synchronize the manual w/ the code.
osh.c 1.2 (jneitzel) 2007/01/14:
* Changed the `chdir: No old directory' diagnostic to
`chdir: No previous directory' to match the manual.
-------------------------------------------------------------------------------
[osh-20061230]:
The following files have been removed in this release:
examples/*: These files are now available at:
http://jneitzel.sdf1.org/osh/initialization_files/
tests/*: ... until I have a chance to rewrite them ...
*.1:
* Changed all instances of `UNIX' to `Unix' since the name
of the Unix operating system is not an acronym.
pexec.c:
* Fixed a possible, but very unlikely, memory leak.
osh.c:
C: Rewrote the shell! It is now a combination of the ports of the
original source code from sh6.c and glob6.c (see CHANGES_sh-to-sh6)
w/ the prior enhancements which were found in osh-060124/osh*.[ch] .
fd2.c:
* Removed the call to lseek(2) to end-of-file for errors.
The shell determines when this is necessary.
* Changed the `: no shell' diagnostic to `: No shell!'
in the spirit of sh6(1).
goto.c:
* Fixed a bug which interfered w/ finding a requested label when
its first character had the high-order bit set. The value of the
first character is now passed to getlabel() as an unsigned char
converted to an int to allow correct comparison in such a case.
if.c:
* Removed the call to lseek(2) to end-of-file for errors.
The shell determines when this is necessary.
* Changed the method used to build the argument list for all commands
executed by this utility, and removed the `Too many args' diagnostic.
The maximum length of the argument list for a command is now limited
only by the maximum length that the invoker can pass and by any
system-imposed limit for execve(2) (see E2BIG in errno(2)).
* Changed the `: no shell' diagnostic to `: No shell!'
in the spirit of sh6(1).
* Changed the diagnostic used for `!', `-a', `-o', and `(' operator
errors from `: argument expected' to `: expression expected'.
INSTALLATION_DIRS, as well as all occurrences of ${PREFIX}/man with
${PREFIX}/${PKGMANDIR}.
Fixes PR 35265, although I did not use the patch provided therein.
Based on PR 22994 by Anthony Mallet.
I modify to adapt to recent pkgsrc tree and update from 1.4 to 1.6.
eltclsh (editline tcl shell) is an interactive shell for the TCL
programming language. It provides command line editing, history browsing
as well as variables and command completion thanks to editline
features. The completion engine is programmable in a way similar to tcsh,
and comes with an programmed completion for the whole TCL language by
default.
The package also provides elwish, an interactive interpreter for the Tk
toolkit.
This document details the changes between this version, bash-3.2-release,
and the previous version, bash-3.2-beta.
1. Changes to Bash
a. Fixed a bug that caused the temporary environment passed to a command to
affect the shell's environment under certain circumstances.
b. Fixed a bug in the printf builtin that caused the %q format specifier to
ignore empty string arguments.
c. Improved multibyte character environment detection at configuration time.
d. Fixed a bug in the read builtin that left spurious escape characters in the
input after processing backslashes when assigning to an array variable.
2. Changes to Readline
a. Fixed a redisplay bug that occurred in multibyte-capable locales when the
prompt was one character longer than the screen width.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.2-beta,
and the previous version, bash-3.2-alpha.
1. Changes to Bash
a. Changed the lexical analyzer to treat locale-specific blank characters as
white space.
b. Fixed a bug in command printing to avoid confusion between redirections and
process substitution.
c. Fixed problems with cross-compiling originating from inherited environment
variables.
d. Added write error reporting to printf builtin.
e. Fixed a bug in the variable expansion code that could cause a core dump in
a multi-byte locale.
f. Fixed a bug that caused substring expansion of a null string to return
incorrect results.
g. BASH_COMMAND now retains its previous value while executing commands as the
result of a trap, as the documentation states.
2. Changes to Readline
a. Fixed a bug with prompt redisplay in a multi-byte locale to avoid redrawing
the prompt and input line multiple times.
b. Fixed history expansion to not be confused by here-string redirection.
c. Readline no longer treats read errors by converting them to newlines, as
it does with EOF. This caused partial lines to be returned from readline().
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.2-alpha,
and the previous version, bash-3.1-release.
1. Changes to Bash
a. Fixed a source bug that caused the minimal configuration to not compile.
b. Fixed memory leaks in error handling for the `read' builtin.
c. Changed the [[ and (( compound commands to set PIPESTATUS with their exit
status.
d. Fixed some parsing problems with compound array assignments.
e. Added additional configuration changes for: NetBSD (incomplete multibyte
character support)
f. Fixed two bugs with local array variable creation when shadowing a variable
of the same name from a previous context.
g. Fixed the `read' builtin to restore the correct set of completion functions
if a timeout occurs.
h. Added code to defer the initialization of HISTSIZE (and its stifling of the
history list) until the history file is loaded, allowing a startup file to
override the default value.
i. Tightened up the arithmetic expression parsing to produce better error
messages when presented with invalid operators.
j. Fixed the cross-compilation support to build the signal list at shell
invocation rather than compile time if cross-compiling.
k. Fixed multibyte support for non-gcc compilers (or compilers that do not
allow automatic array variable sizing based on a non-constant value).
l. Several fixes to the code that manages the list of terminated jobs and
their exit statuses, and the list of active and recently-terminated jobs
to avoid pid aliasing/wraparound and allocation errors.
m. Fixed a problem that allowed scripts to die due to SIGINT while waiting
for children, even when started in the background or otherwise ignoring
SIGINT.
n. Fixed a bug that caused shells invoked as -/bin/bash from not being
recognized as login shells.
o. Fixed a problem that caused shells in the background to give the terminal
to a process group other than the foreground shell process group.
p. Fixed a problem with extracting the `varname' in ${#varname}.
q. Fixed the code that handles SIGQUIT to not exit immediately -- thereby
calling functions that may not be called in a signal handler context --
but set a flag and exit afterward (like SIGINT).
r. Changed the brace expansion code to skip over braces that don't begin a
valid matched brace expansion construct.
s. Fixed `typeset' and `declare' to not require that their shell function
operands to be valid shell identifiers.
t. Changed `test' to use access(2) with a temporary uid/euid swap when testing
file attributes and running setuid, and access(2) in most other cases.
u. Changed completion code to not attempt command name completion on a line
consisting solely of whitespace when no_empty_command_completion is set.
v. The `hash' builtin now prints nothing in posix mode when the hash table is
empty, and prints a message to that effect to stdout instead of stderr
when not in posix mode.
w. Fixed a bug in the extended pattern matching code that caused it to fail to
match periods with certain patterns.
x. Fixed a bug that caused the shell to dump core when performing filename
generation in directories with thousands of files.
y. Returned to the original Bourne shell rules for parsing ``: no recursive
parsing of embedded quoted strings or ${...} constructs.
z. The inheritence of the DEBUG, RETURN, and ERR traps is now dependent only
on the settings of the `functrace' and `errtrace' shell options, rather
than whether or not the shell is in debugging mode.
aa. Fixed a problem with $HOME being converted to ~ in the expansion of
members of the DIRSTACK array.
bb. Fixed a problem with quoted arguments to arithmetic expansions in certain
constructs.
cc. The command word completion code now no longer returns matching directories
while searching $PATH.
dd. Fixed a bug with zero-padding and precision handling in snprintf()
replacement.
ee. Fixed a bug that caused the command substitution code not to take embedded
shell comments into account.
ff. Fixed a bug that caused $((...);(...)) to be misinterpreted as an
arithmetic substitution.
gg. Fixed a bug in the prompt expansion code that inappropriately added a
\001 before a \002 under certain circumstances.
hh. Fixed a bug that caused `unset LANG' to not properly reset the locale
(previous versions would set the locale back to what it was when bash
was started rather than the system's "native" locale).
ii. Fixed a bug that could cause file descriptors > 10 to not be closed even
when closed explicitly by a script.
jj. Fixed a bug that caused single quotes to be stripped from ANSI-C quoting
inside double-quoted command substitutions.
kk. Fixed a bug that could cause core dumps when `return' was executed as the
last element of a pipeline inside a shell function.
ll. Fixed a bug that caused DEBUG trap strings to overwrite commands stored in
the jobs list.
2. Changes to Readline
a. Fixed a problem that caused segmentation faults when using readline in
callback mode and typing consecutive DEL characters on an empty line.
b. Fixed several redisplay problems with multibyte characters, all having to
do with the different code paths and variable meanings between single-byte
and multibyte character redisplay.
c. Fixed a problem with key sequence translation when presented with the
sequence \M-\C-x.
d. Fixed a problem that prevented the `a' command in vi mode from being
undone and redone properly.
e. Fixed a problem that prevented empty inserts in vi mode from being undone
properly.
f. Fixed a problem that caused readline to initialize with an incorrect idea
of whether or not the terminal can autowrap.
g. Fixed output of key bindings (like bash `bind -p') to honor the setting of
convert-meta and use \e where appropriate.
h. Changed the default filename completion function to call the filename
dequoting function if the directory completion hook isn't set. This means
that any directory completion hooks need to dequote the directory name,
since application-specific hooks need to know how the word was quoted,
even if no other changes are made.
i. Fixed a bug with creating the prompt for a non-interactive search string
when there are non-printing characters in the primary prompt.
j. Fixed a bug that caused prompts with invisible characters to be redrawn
multiple times in a multibyte locale.
k. Fixed a bug that could cause the key sequence scanning code to return the
wrong function.
l. Fixed a problem with the callback interface that caused it to fail when
using multi-character keyboard macros.
m. Fixed a bug that could cause a core dump when an edited history entry was
re-executed under certain conditions.
n. Fixed a bug that caused readline to reference freed memory when attmpting
to display a portion of the prompt.
3. New Features in Bash
a. Changed the parameter pattern replacement functions to not anchor the
pattern at the beginning of the string if doing global replacement - that
combination doesn't make any sense.
b. When running in `word expansion only' mode (--wordexp option), inhibit
process substitution.
c. Loadable builtins now work on MacOS X 10.[34].
d. Shells running in posix mode no longer set $HOME, as POSIX requires.
e. The code that checks for binary files being executed as shell scripts now
checks only for NUL rather than any non-printing character.
f. Quoting the string argument to the [[ command's =~ operator now forces
string matching, as with the other pattern-matching operators.
4. New Features in Readline
a. Calling applications can now set the keyboard timeout to 0, allowing
poll-like behavior.
b. The value of SYS_INPUTRC (configurable at compilation time) is now used as
the default last-ditch startup file.
c. The history file reading functions now allow windows-like \r\n line
terminators.
Patch provided by Martin Wilke via PR 34313.
[osh-060124]:
Makefile:
* Added targets for building/installing sh6(1) and glob6(1).
Refer to the README file for further details.
* Removed the `check-sh6' target since the tests were originally
written for osh(1) and sh6(1) as Thompson-shell reimplementations,
not ports.
sh6:
* Changed sh6(1) from being a reimplementation which is compiled from
the same sources as osh(1) to being a port of the original Thompson
shell from Sixth Edition Unix. Refer to the CHANGES_sh-to-sh6 file
for further details.
osh:
C: Treat both `( ; )' and `( & )' as syntax errors.
C: Print the process ID for each command of an asynchronous pipeline,
not just the last command.
C: Added the `newgrp' special command. It is similar to `login'
except that the newgrp(1) utility replaces the current interactive
shell rather than the login(1) utility.
* When opening `/dev/null' is needed for an asynchronous command,
call open(2) w/ the O_RDONLY flag instead of O_RDWR.
From DESCR:
mksh is the MirBSD enhanced version of the Public Domain Korn
shell (pdksh), a bourne-compatible shell which is largely si-
milar to the original AT&T Korn shell. It includes bug fixes
and feature improvements in order to produce a modern, robust
shell good for interactive and especially script use.
New in this release
=====================
** Support for interix
** Ignoring of synchronous signals
The procedures IGNORE-SIGNAL and HANDLE-SIGNAL-DEFAULT have been
added.
** Support for gcc 4.0
** 0.6 for module path
The standard module path now contains
${prefix}/lib/scsh/modules/0.6 in addition to
$prefix/lib/scsh/modules for compatibility with install-lib
** New implementation of open-pty
Instead of search for /dev/pty??, scsh now tries a wide variety of
ways to aquire a new pty and the corresponding tty.
** Bug fixes
argv[0] is now the first element of command-line
Fixes found by new test suite
Regexp for empty string
Argument checking for COPY-BYTES!
GC_PROTECTs for send_substring
format_date support for #f timezone
Added predicates for user-info and group-info
Reaping of stopped processes: Do not mark stopped processes as dead
md5-digest-for-port
| regexps return char-sets
standard-let in srfi-5
(%)read-delimited! checks for mutable buffer
leap second for srfi-19
The default image for the scshvm is now the installed scsh.image.
PKGLOCALEDIR and which install their locale files directly under
${PREFIX}/${PKGLOCALEDIR} and sort the PLIST file entries. From now
on, pkgsrc/mk/plist/plist-locale.awk will automatically handle
transforming the PLIST to refer to the correct locale directory.
RECOMMENDED is removed. It becomes ABI_DEPENDS.
BUILDLINK_RECOMMENDED.foo becomes BUILDLINK_ABI_DEPENDS.foo.
BUILDLINK_DEPENDS.foo becomes BUILDLINK_API_DEPENDS.foo.
BUILDLINK_DEPENDS does not change.
IGNORE_RECOMMENDED (which defaulted to "no") becomes USE_ABI_DEPENDS
which defaults to "yes".
Added to obsolete.mk checking for IGNORE_RECOMMENDED.
I did not manually go through and fix any aesthetic tab/spacing issues.
I have tested the above patch on DragonFly building and packaging
subversion and pkglint and their many dependencies.
I have also tested USE_ABI_DEPENDS=no on my NetBSD workstation (where I
have used IGNORE_RECOMMENDED for a long time). I have been an active user
of IGNORE_RECOMMENDED since it was available.
As suggested, I removed the documentation sentences suggesting bumping for
"security" issues.
As discussed on tech-pkg.
I will commit to revbump, pkglint, pkg_install, createbuildlink separately.
Note that if you use wip, it will fail! I will commit to pkgsrc-wip
later (within day).
branch.
Major changes between versions 4.2 and 4.3
------------------------------------------
- There is support for multibyte character sets in the line editor,
though not the main shell. See Multibyte Character Support in INSTALL.
- The shell can now run an installation function for a new user
(one with no .zshrc, .zshenv, .zprofile or .zlogin file) without any
additional setting up by the administrator.
- The manual now has a Roadmap section (manual page zshroadmap) to
give new users an indication of the most interesting parts of the manual.
- New option PROMPT_SP, on by default, to work around the problem that the
line editor can overwrite output with no newline at the end.
- New option HIST_SAVE_BY_COPY (on by default): history is saved by
copying and renaming instead of directly overwriting.
- New redirection syntax e.g. {myfd}>file opens a new file descriptor
and stores the number in $myfd, so that >&$myfd will work. Chosen not to
break existing code (and to be compatible with proposals for the Korn
shell).
- Substitutions of the form ${var:-"$@"}, ${var:+"$@"} and similar where
word-splitting is applied to the text after the :- or :+ (in particular,
where the SH_WORD_SPLIT option is in effect for compatibility) now behave
as in other Bourne- and POSIX-compatible shells when in the appropriate
emulation mode.
- New Posix-style zsh-specific tests [[:IDENT:]], [[:IFS:]],
[[:IFSSPACE:]], [[:WORD:]] test if character can appear in identifier, is
an IFS character, is an IFS whitespace character, or is considered as part
of a word (is alphanumeric or appears in $WORDCHARS). Note the pattern
code doesn't yet handle multibyte characters.
- The idiom =(<<<...) is optimised so that the shell internally turns
the ... into the contents of a file whose name is then substituted.
- Supplied functions catch and throw provide limited support for
exception handling using the `{ ... } always { ... }' syntax.
- Signals now accept the SIG as part of the name for compatibility with
other shells.
- Editor function argument-base allows non-decimal arguments for
editor widgets.
- As always, there are many enhancements to completion functions.
makeinfo if no native makeinfo executable exists. Honor TEXINFO_REQD
when determining whether the native makeinfo can be used.
* Remove USE_MAKEINFO and replace it with USE_TOOLS+=makeinfo.
* Get rid of all the "split" argument deduction for makeinfo since
the PLIST module already handles varying numbers of split info files
correctly.
NOTE: Platforms that have "makeinfo" in the base system should check
that the makeinfo entries of pkgsrc/mk/tools.${OPSYS}.mk are
correct.
developer is officially maintaining the package.
The rationale for changing this from "tech-pkg" to "pkgsrc-users" is
that it implies that any user can try to maintain the package (by
submitting patches to the mailing list). Since the folks most likely
to care about the package are the folks that want to use it or are
already using it, this would leverage the energy of users who aren't
developers.
"extract" script for extraction. Many cases where a custom EXTRACT_CMD
simply copied the distfile into the work directory are no longer
needed. The extract script also hides differences between pax and
tar behind a common command-line interface, so we no longer need code
that's conditional on whether EXTRACT_USING is tar or pax.
Changes since last packaged version (2.3.0):
2.3.2
- fixed segfault due to checking the length of variables that I forgot to
remove from build_arg_vector() since the chroot root exploit fix in 2.3.0
2.3.1
- fixed stupid bug that caused rssh not to allow rsync and rdist
rather than PKG_FAIL_REASON, so that they provide useful error
messages in build logs, and so that they continue to work on platforms
where they aren't broken.
This is a terse description of the new features added to bash-3.1 since
the release of bash-3.0. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
1. New Features in Bash
a. Bash now understands LC_TIME as a special variable so that time display
tracks the current locale.
b. BASH_ARGC, BASH_ARGV, BASH_SOURCE, and BASH_LINENO are no longer created
as `invisible' variables and may not be unset.
c. In POSIX mode, if `xpg_echo' option is enabled, the `echo' builtin doesn't
try to interpret any options at all, as POSIX requires.
d. The `bg' builtin now accepts multiple arguments, as POSIX seems to specify.
e. Fixed vi-mode word completion and glob expansion to perform tilde
expansion.
f. The `**' mathematic exponentiation operator is now right-associative.
g. The `ulimit' builtin has new options: -i (max number of pending signals),
-q (max size of POSIX message queues), and -x (max number of file locks).
h. A bare `%' once again expands to the current job when used as a job
specifier.
i. The `+=' assignment operator (append to the value of a string or array) is
now supported for assignment statements and arguments to builtin commands
that accept assignment statements.
j. BASH_COMMAND now preserves its value when a DEBUG trap is executed.
k. The `gnu_errfmt' option is enabled automatically if the shell is running
in an emacs terminal window.
l. New configuration option: --single-help-strings. Causes long help text
to be written as a single string; intended to ease translation.
m. The COMP_WORDBREAKS variable now causes the list of word break characters
to be emptied when the variable is unset.
n. An unquoted expansion of $* when $IFS is empty now causes the positional
parameters to be concatenated if the expansion doesn't undergo word
splitting.
o. Bash now inherits $_ from the environment if it appears there at startup.
p. New shell option: nocasematch. If non-zero, shell pattern matching ignores
case when used by `case' and `[[' commands.
q. The `printf' builtin takes a new option: -v var. That causes the output
to be placed into var instead of on stdout.
r. By default, the shell no longer reports processes dying from SIGPIPE.
s. Bash now sets the extern variable `environ' to the export environment it
creates, so C library functions that call getenv() (and can't use the
shell-provided replacement) get current values of environment variables.
t. A new configuration option, `--enable-strict-posix-default', which will
build bash to be POSIX conforming by default.
u. If compiled for strict POSIX conformance, LINES and COLUMNS may now
override the true terminal size.
2. New Features in Readline
a. The key sequence sent by the keypad `delete' key is now automatically
bound to delete-char.
b. A negative argument to menu-complete now cycles backward through the
completion list.
c. A new bindable readline variable: bind-tty-special-chars. If non-zero,
readline will bind the terminal special characters to their readline
equivalents when it's called (on by default).
d. New bindable command: vi-rubout. Saves deleted text for possible
reinsertion, as with any vi-mode `text modification' command; `X' is bound
to this in vi command mode.
e. A new external application-controllable variable that allows the LINES
and COLUMNS environment variables to set the window size regardless of
what the kernel returns: rl_prefer_env_winsize
Note that this is (mostly) a security fix release.
Changes since last packaged version (2.2.3):
2.3.0
- modified chroot_helper to parse the config file, to avoid arbitrary
chroot() (and thus root compromise)
- numerous documentation updates
- fix for va_start()/va_end()-related segfault on 64-bit architecture
- small bit of code cleanup
DEFAULT_PATH_VALUE as /usr/bin:/bin:${LOCALBASE}/bin:/usr/local/bin
(Instead of having non-existent default PATH directories.)
Bump PKGREVISION.
This is for PR 25044.
Okayed by bash2 maintainer.
- Changed IRIX, Interix, Linux and OpenBSD share PLIST.terminfo,
instead of PLIST for each OS.
- zsh doesn't build libzsh-4.2.5.so on OpenBSD, so PLIST.shlibs
should be excluded.
+SHELL.
* Turn PKG_REGISTER_SHELLS into a variable that can be set in the shell
environment so that admins can make a choice when installing from
binary packages.
* PKG_SHELL is now a list of paths, and if the path is relative, then it
is taken to be relative to ${PREFIX}. Convert packages that set
PKG_SHELL to take advantage of this new feature by changing the full
paths to the shells into relative paths.
around at either build-time or at run-time is:
USE_TOOLS+= perl # build-time
USE_TOOLS+= perl:run # run-time
Also remove some places where perl5/buildlink3.mk was being included
by a package Makefile, but all that the package wanted was the Perl
executable.
PKGREVISION due to the added dependency. This should fix PR pkg/30601.
While here, set BUILDLINK_DEPMETHOD of dependent libraries to "build"
when the "static" option is enabled.
PKGREVISION due to the added dependency.
While here, set BUILDLINK_DEPMETHOD of dependent libraries to "build"
when the "static" option is enabled.
Approved by the maintainer (wiz@).
Based on rssh package in pkgsrc-wip by pancake at phreaker dot net,
slightly modified and updated to latest version by myself.
Claim stewardship.
Rssh is a restricted shell for use with OpenSSH, allowing only scp
and/or sftp. For example, if you have a server which you only want
to allow users to copy files off of via scp, without providing
shell access, you can use rssh to do that.
posh (0.3.14) unstable; urgency=medium
* ifdef out shf_smprintf.
-- Clint Adams <schizo@debian.org> Fri, 19 Nov 2004 13:11:55 -0500
posh (0.3.13) unstable; urgency=medium
* Some documentation cleanup and fixes.
* Get the Latin-1 non-breeakable spaces out of the manpage for
now. closes: #280624.
Hopefully the DocBook XSL stylesheets will be fixed some year.
-- Clint Adams <schizo@debian.org> Fri, 12 Nov 2004 14:20:35 -0500
posh (0.3.12) unstable; urgency=medium
* Add regression test for unset builtin. closes: #273346.
* Make "eval false || true" not exit with -e. closes: #269066.
-- Clint Adams <schizo@debian.org> Sat, 25 Sep 2004 22:41:59 -0400
posh (0.3.11) unstable; urgency=medium
* Fix return value of unset builtin when parameters are not set;
(according to POSIX, this is not an error condition).
-- Clint Adams <schizo@debian.org> Thu, 23 Sep 2004 22:08:57 -0400
posh (0.3.10) unstable; urgency=low
* Remove extraneous operators from "test" builtin (-a, -G, -H, -k,
-O, -o, <, >, -ef, -nt, -ot).
New Features:
* UTF-8 handling for both singe and double width characters
* termname builtin for testing whether a terminal type is
available in termcap/terminfo
examples:
* Updated the example initialization files.
* Added a few command files to give users a head start
in scripting the shell.
osh.1 and sh6.1:
* Made a few more minimal revisions.
osh and sh6:
* Did a little more code cleanup.
NB: this needs an install-sh that supports "-S -f", as in rev. 1.3 of
bootstrap/files/install-sh.in. After installing that install-sh, set
_STRIPFLAG_INSTALL?= -S -f
in mk/platform/IRIX.mk and all should be peachy. This will be done
correctly eventually, don't worry. :-)
Changes that improve compatibility w/ the Sixth Edition Unix shell
are marked w/ a `C:' in the details below.
-------------------------------------------------------------------------------
[osh-041028]:
*.1:
* Fixed a few typos in osh.1 and sh6.1.
* Did a little fine tuning of osh.1 and sh6.1 to hopefully
eliminate some incomplete and/or unclear explanations.
* Did the same for both if.1 and goto.1.
osh and sh6:
* Fixed an annoying bug introduced in the previous release...
The way error messages were printed in error() was not accounting
for the fact that the standard error stream is quite often (if not
always) unbuffered by default. This could make some error messages
difficult to read when a pipeline was involved. A little example:
Before (unfixed):
% foo|bar|baz
foo: not foundbar: not foundbaz: not found
After (fixed):
% foo|bar|baz
foo: not found
bar: not found
baz: not found
-------------------------------------------------------------------------------
[osh-041018]:
This release includes sh6 in addition to osh, if, and goto.
Sh6 is simply osh without the enhancements. It is built from the
same sources as osh, but it is not built or installed by default.
Makefile:
* Added targets for sh6 so that it can optionally be built, tested,
and installed if desired.
osh and sh6:
* Split the code into modules.
This is primarily for developer sanity... ;)
The new files are osh.h, main.c, parse.c, and exec.c.
* If (geteuid() != getuid() || getegid() != getgid()) is true,
print a nice error message and exit with a status of 2.
* Strip all NUL characters from the shell's standard input as it is
being read into the command line buffer. Input to the shell is
expected to be text.
* Changed the way the shell handles non-seekable files.
This is for both initialization files (osh only) and command files.
Do not block on open(2); open it and determine if it is a regular
file (or seekable). If it is not a regular file or is not seekable,
exit with an error. If seekable, reset the file for blocking I/O
and continue as normal.
Note that you can still read commands from FIFOs if you want.
Instead of doing `osh myfifo', you can either do `osh <myfifo'
or `osh - my list of positional parameters <myfifo'.
* Changed the error handling to use stdarg(3).
This allows for more code consistency and makes it easier
to handle all errors with just one line of code.
osh only:
* Added another possible initialization file for osh: $HOME/.oshrc
Osh only attempts to execute commands from this file if it is an
interactive shell. In the case of a login shell, osh tries this
file only after it tries both /etc/osh.login and $HOME/.osh.login.
* Made osh less strict about errors in initialization files.
Previously, common shell-detected errors in any of the files
were generally treated in the same way as they would have been
treated in a command file (i.e., the error was fatal). Realizing
that this potentially caused difficulty and annoyance for the user,
I opted to change it so that these types of errors are handled as
they are when osh is interactive.
This should make it easier for the user to debug
initialization files if needed.
* Added a `source' special command.
It is functionally similar to the way this command works in csh(1).
See osh(1) for details.
if:
* Changed ARGMAX from 50 to 256.
* If (geteuid() != getuid() || getegid() != getgid()) is true,
print a nice error message and exit with a status of 2.
* Added a few new primaries: `-h', `-s', `-t', and `-x'
See if(1) for details.
goto:
* Changed the size of the label buffer from 128 to 1024.
* Do not require the `:' of a labelled line to appear in column 1.
Instead, allow the `:' to optionally be preceded by blanks so that
labelled lines can be indented in command files. See goto(1) for
more details if needed.
* Eliminated unnecessary calls to strcmp(3) whenever a possible label
cannot possibly match the label argument given on the command line.
* Give an error if any NUL character is encountered in the input.
* Give an error if a zero-length string is given as the label argument.
-------------------------------------------------------------------------------
[osh-040812]:
osh.c:
* Changed the way unused pipe descriptors are handled in the child
process after fork(). This fixes a bug where the pipe in a pipeline
such as `( cat /dev/zero ) | sleep 1' would never enter an EOF state.
Previously, the close-on-exec flag was being set for the descriptors
in question. Of course, this did not work for the above and similar
cases. So, the descriptors in question are now close()d explicitly.
* Made some final changes to globbing to allow for more sensible
behaviour WRT quoting. The functions affected are: globargs(),
globchar(), and striparg(). Read and/or run `tests/glob_test.osh'
for details of the user-visible changes. This script may cause
previous versions of the shell to dump core.
Basically, since striparg() had always been called *after* glob(3)
and since the path names generated by glob(3) cannot be trusted, it
ends up that the best course of action is to call striparg() *before*
glob(3). This relatively simple change fixes a variety of *possible*
problems related to globbing.
-------------------------------------------------------------------------------
[osh-040731]:
osh.c:
* Added bounds checking to striparg() to protect against a possible
buffer overflow. Though this is unlikely to happen in the general
case, it is certainly *not* impossible. This function had been
unprotected since at least osh-020214.
* Added a new diagnostic, `Arg too long', to go with the
above-mentioned change.
* Removed the `No directory' diagnostic from globargs().
It was simply not worth the trouble. In compatible mode,
the `No match' diagnostic provides sufficient compatibility
in my opinion...
* Changed the `chdir' command so that it only attempts to change to
the previous working directory when the `-' argument is *not* quoted.
This alows the shell to change to a directory by that name.
For example:
% mkdir -; chdir -; pwd; chdir \-; pwd; chdir -; pwd; rmdir -
chdir: no old directory
/home/jneitzel/osh_stuff/osh-040731
/home/jneitzel/osh_stuff/osh-040731/-
/home/jneitzel/osh_stuff/osh-040731
Remember that "-" or '-' has the same effect as the \- used above.
This is perhaps a little silly, but I figure if a directory *can*
exist then it should be possible to change to it.
* Fixed the `<-' redirection argument so that it adheres to the
documentation. This fixes a file descriptor leak in addition
to the incorrect behaviour. It should be silently ignored in
the following case: `echo hello | grep h <-'; now it is.
-------------------------------------------------------------------------------
[osh-040723]:
osh.c:
C: Fixed a small idiosyncrasy with the `No directory' and `No match'
diagnostics when running in compatible mode. For example:
Before:
% if -d . -a -r . echo "`.' is a readable directory.";\
echo foo*; echo ?; echo []
`.' is a readable directory.
No match
No match
No directory
After:
% if -d . -a -r . echo "`.' is a readable directory.";\
echo foo*; echo ?; echo []
`.' is a readable directory.
No match
No match
No match
The shell should only print `No directory' when a directory
does not exist (ENOENT) or cannot be read (EACCES). Yes, it is
expected that invalid patterns such as `[' and `[]' result in
the shell printing a `No match' diagnostic.
* Changed the `<--' input redirection argument to `<-' instead.
This seems more consistent and will allow for possibly clearer
documentation in the future (if and when I add another feature
I've been thinking about).
fd2.[1c]:
* Removed the fd2 utility and its manual page because of
possible licensing issues.
-------------------------------------------------------------------------------
[osh-040718]:
This release is made primarily to synchronize with the new branch
of the shell which is named `sh6'.
osh.1:
* More revisions and clarifications...
-------------------------------------------------------------------------------
[osh-040714]:
Makefile:
* Refined the description for _XOPEN_SOURCE a little.
osh.1:
* General improvements...
This includes documenting some things that have never been very well
documented in this shell.
osh.c:
C: Made changes to globbing which affect the shell in compatible mode.
This includes the addition of the `No directory' diagnostic which
was present in /etc/glob from Sixth Edition Unix. Also, it looks
like I had previously misinterpreted exactly when the `No match'
diagnostic was supposed to be printed. Now, when running in
compatible mode the shell really is compatible. Yay =)
* Added a `umask' special command.
* Disallow SIGCHLD from being trapped.
When this signal is requested in a `trap' command, it is quietly
disallowed. This is the same behaviour seen with both SIGKILL and
SIGSTOP. Thus, doing a `trap + 9 17 20' quietly has no effect.
* Made changes to how the shell builds a command's argument vector.
Previously, malloc(3) was used. Now, each command in the command
line is simply split into `\0'-terminated words. Each argument is
actually a pointer to the corresponding word in the command line.
The changes to parameter substitution in osh-040628 made this
a perfectly sensible course of action. This change also gives
a microscopic improvement in run-time performance (as judged
by time(1)).
The only remaining use of malloc(3) in the shell's execution stage
can be found in globargs().
-------------------------------------------------------------------------------
[osh-040628]:
Thanks to Stephen M. Jones for suggesting that osh should be able
to read a global rc file. Thanks to Stephen C. VanDahm for assisting
with some portability issues found in osh-040421. Thanks also to
Josep Portella Florit for reviewing osh-040421, making several useful
suggestions, and sending patches.
BTW, many changes were made to the manual pages.
I hope they are clear, but I trust that if they are not then someone
might be kind enough to tell me so and/or make suggestions.
Some new files are included:
examples/*: initialization file examples
fd2.[1c]: the fd2 utility
Makefile:
* Added some notes about _XOPEN_SOURCE.
* Added a target to optionally build and install fd2.
* Removed the compile-time definition of `CLONE'.
This is now a run-time option which can be toggled in order to
enable or disable enhancements to the shell.
osh.c:
C: Changed how the shell does parameter substitution.
This was the last major incompatibility w/ the Thompson shell.
Now, substitution is done *before* any command-line parsing
takes place.
* Added the ability for login shells to read the initialization files
/etc/osh.login and/or $HOME/.osh.login if they exist. A shell is
considered to be a login shell if its first argument starts w/ a
`-' character (e.g., -osh).
* Added a `set' command to allow shell compatibility to be toggled
at run time. In addition, the shell now checks for `OSH_COMPAT'
in the environment to tell future invocations of the shell which
mode the user wishes to run in.
* In addition to the `set' command mentioned above, the following
special built-in commands have been added and are available when
the shell is in "noclone" mode:
exec, setenv, trap, unsetenv
* In globargs(), use `gl_pathc == 0' to detect an unmatched pattern
instead of checking if glob(3) returned `GLOB_NOMATCH'. This allows
for those cases where glob(3) may not be POSIX-compliant.
* Made osh command files that are run asynchronously ignore interrupts.
For example, `osh runcom&' should ignore SIGINT and SIGQUIT, and now
it does.
* Reverted a so-called compatibility fix made in osh-040421.
Now, ignore SIGINT and SIGQUIT for asynchronous commands invoked
from a command file. From a usability perspective, it is simply
too annoying to not do it this way.
* Changed the `exit' command so that it always terminates a shell when
reading commands from a file. Previously, it only terminated a shell
when invoked as `osh file'. Note that `exit' still has no effect for
interactive shells or `osh -c command'; this is intentional as it is
compatible w/ the behaviour of `exit' under the Thompson shell.
if.c:
* Include stdlib.h for exit(3) so that OS X doesn't complain.
* Rename exp() to expr() to avoid conflicts w/ exp(3) on OS X.
Strange, as math.h is not included there should not have been
any conflict. Oh well, it is fixed now.
* Enable this utility to return a meaningful exit status to the user.
In short, `if foo = foo' returns an exit status of 0; `if foo = bar'
returns an exit status of 1. Previously, exit status was always 0.
* Made the usage less ambiguous; corrected the documentation to reflect
the actual behaviour. In short, usage is (and always has been) as
follows:
if expr [command [arg ...]]
* Added some useful conditional primaries for constructing expressions.
See the manual pages for details.
* Use the stdio(3) functions instead of write(2) for printing
the error messages.
* In addition, added some useful diagnostic messages which were
inspired by the test(1) utility from Seventh Edition Unix.
goto.c:
* Give an error message when standard input is not seekable.
Previously, a label not found error would be produced instead.
fd2.c:
* A new utility and manual page... It is an adaptation of the PWB/Unix
(roughly PWB/1.0 ?) redirect diagnostic output command. The original
source came from the file `spencer_pwb.tar.gz' which can be found at:
http://www.tuhs.org/Archive/PDP-11/Distributions/usdl/
in the process. (More information on tech-pkg.)
Bump PKGREVISION and BUILDLINK_DEPENDS of all packages using libtool and
installing .la files.
Bump PKGREVISION (only) of all packages depending directly on the above
via a buildlink3 include.
patch provided by pancake at phreaker.net in PR 26777
changes (from Debian changelog):
posh (0.3.9) unstable; urgency=medium
* trap builtin now errors when no signals are specified.
closes: #265103.
* Move trap-related regression tests to their own file,
and add one to check for error on "trap 0".
posh (0.3.8) unstable; urgency=high
* Fix tilde expansion thinko introduced in 0.3.4.
posh (0.3.7) unstable; urgency=low
* Remove some cruft left around from ksh functions.
posh (0.3.6) unstable; urgency=low
* Add a better regression test for umask.
* Drop support of ksh88 ":[#%]+"-type trimming.
* Adjust regression tests to make sure ${blah:#blah} gives
an error.
posh (0.3.5) unstable; urgency=low
* Clean unused variables left after 0.3.4.
* Add prebuild target to debian/rules.
* Drop qsort altogether.
posh (0.3.4) unstable; urgency=low
* Fix most of the signedness comparison warnings.
* Remove homedir caching code.
* Switch specials, keywords, aliases, builtins, vars, and funs hashes
to use libc tsearch() and friends.
* Remove old table hash routines.
posh (0.3.3) unstable; urgency=low
* Rename custom table functions to prevent conflicts with
b-tree functions when search.h is included.
* Remove vestigial tracked alias code.
posh (0.3.2) unstable; urgency=low
* Make getn() use strtol().
* Mark unused function parameters to avoid gcc warnings.
posh (0.3.1) unstable; urgency=low
* Use libc's instead of internal qsort.
* Add -W to CFLAGS.
which are the full option names used to set rpath directives for the
linker and the compiler, respectively. In places were we are invoking
the linker, use "${LINKER_RPATH_FLAG} <path>", where the space is
inserted in case the flag is a word, e.g. -rpath. The default values
of *_RPATH_FLAG are set by the compiler/*.mk files, depending on the
compiler that you use. They may be overridden on a ${OPSYS}-specific
basis by setting _OPSYS_LINKER_RPATH_FLAG and _OPSYS_COMPILER_RPATH_FLAG,
respectively. Garbage-collect _OPSYS_RPATH_NAME and _COMPILER_LD_FLAG.
into the bsd.options.mk framework. Instead of appending to
${PKG_OPTIONS_VAR}, it appends to PKG_DEFAULT_OPTIONS. This causes
the default options to be the union of PKG_DEFAULT_OPTIONS and any
old USE_* and FOO_USE_* settings.
This fixes PR pkg/26590.
1.) Only create a dynamically linked "zsh" binary if "MKDYNAMICROOT"
is defined and set to "yes". This way people who still use statically
linked binaries on their root filesystem will get a static binary.
2.) Link the "zsh" binary so that it use "/libexec/ld.elf_so" and
shared libraries from "/lib". It now works without the "/usr"
filesystem being mounted.
dynamic library support on the root partition (e.g. 2.0 and newer). It is
enough that the "zsh" binary does *not* depend on its own shared libraries
which won't be on the root partition and we get a shell with proper I18N
support this way. Approved by Masao Uebayashi.
Changes since zsh version 4.2.0
-------------------------------
- The autoload and related builtins take options -k and -z to indicate
ksh or zsh autoloading style for given functions, making it possible
to mix and match.
- Assignments to associative arrays can use the i and r index flags.
For example,
assoc[(i)alpha*]=bravo
sets the value for the element whose key matches the pattern `alpha*';
assoc[(r)activ*]=passive
sets the value for the element whose current value matches the pattern
`activ*'.
- The glob qualifier F indicates a non-empty directory. Hence *(F)
indicates all subdirectories with entries, *(/^F) means all
subdirectories with no entries.
- fc -p and fc -P provide push/pop for the status of the shell's
history (both internal and using the history file). With automatic
scoping (fc -ap) it becomes easy to use a temporary history in a
function. This has been added to the calculator function zcalc to make
its internal history work more seamlessly.
- A new `try block' and `always block' syntax has been introduced
to make it easier to ensure the shell runs important tidy-up code
in the event of an error. It also runs after a break, continue, or
return, including a return forced by the ERR_RETURN option
(but not an exit, which is immediate). The syntax is:
`{' try-block-list `}' `always' `{' always-block-list `}'
where no newline or semicolon may appear between `}' and `always'.
This is compatible with all previous valid zsh syntax as an `always'
at that point used to be a syntax error. For example,
{ echo Code run in current shell } always { echo Tidy-up code }
- A new zle widget reset-prompt has been added to re-expand the current
prompt. Changes to the variable in use as well as changes in its
expanions are both taken into account. The same effect is now forced by
a job change notification, making the %j prompt escape and %(j..) ternary
expression more useful.
- The zftp module supports ports following the hostname in the normal suffix
notation, `host:port'. This requires IPv6 colon-style addresses to be
specified in suitably quoted square brackets, for example:
zftp open '[f000::baaa]'
zftp open '[f000::baaa]:ftp'
(the two are equivalent).
- Special traps, those that don't correspond to signals, i.e. ZERR, DEBUG
and EXIT are no longer executed inside other traps. This caused
unnecessary confusion if, for example, both DEBUG and EXIT traps
were set. The new behaviour is more compatible with other shells.
- New option TRAPS_ASYNC which if set allows traps to run while the
shell is waiting for a child process. This is the traditional zsh
behaviour; POSIX requires the option to be unset. In sh/ksh
compatibility mode the option is turned off by default and the option
letter -T turns it on, for compatibility with FreeBSD sh.
previous patches disabled it on NetBSD unconditionally. Bump PKGREVISION.
Pointed out by Kibum Han. Thanks to junyoung@ for testing.
OK'ed by schmonz@ and wiz@.