This is my port of the OpenBSD ksh shell for all my machines not running OpenBSD.
Barely compiles and kinda runs (thanks to many ugly hacks) on:
- macOS (tested on 10.13, 10.14)
- Linux (tested on Ubuntu 18.04)
Just do it, you know you want to:
$ brew install tamentis/core/openbsd-ksh
$ sudo apt-get update
$ sudo apt-get install make gcc libc-dev ncurses-dev
Then continue with the generic instructions below.
$ sudo yum install gcc make ncurses-devel
Then continue with the generic instructions below.
$ ./configure
$ make
$ sudo make install
- There is no call to
pledge()
, since it does not exist outside of OpenBSD. - This package will not install ksh as sh replacement, neither will it install the corresponding sh man page, this is not intended as a system shell.
- Bound ^L (ctrl-l) to clear the screen rather than redrawing.
- Addressed inconsistent behavior when evaluating arithmetical expressions.
- Skip most of the mail check if MAIL is not set.
- Fixed the case where the recursion detection isn't reset when the command is interrupted.
- Support 64 bit integers on 32 bit architectures.
- Memory allocation was switched from calloc(3) back to malloc(3), making it easier to recognize uninitialized memory. As a result, a history-related bug in emacs editing mode was discovered and fixed.
- Improved UTF-8 line editing support for Emacs and Vi input mode.
- Partial UTF-8 line editing support for Vi input mode.
- Improve various details of POSIX compliance.
- Partial support for inserting and deleting UTF-8 characters in emacs command line editing mode.
I cannot be held responsible for whatever damage is done to your system from using that code. It is provided AS IS, with NO WARRANTY, either expressed or implied.
Via CVS:
- clone the repo for whatever branch you want:
$ cvs -d [email protected]:/cvs co -rOPENBSD_6_3 src/bin/ksh
- hack away, diff, incorporate
- pull request?
Via the GitHub clone:
- Clone the clone:
git clone https://github.com/openbsd/src
- Export the patches one by one, edit the path, import:
$ git format-patch -1 --stdout e2d3b05ea4601a... > /tmp/patch
$ vim /tmp/patch
$ git am /tmp/patch