You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Brian Callahan 4c94c69373 Release oksh-7.0 2 weeks ago
CVS Release oksh-7.0 2 weeks ago
.gitignore Add pconfig.h to .gitignore 3 years ago
.travis.yml Travis-CI is removing osx_image: xcode6.4 soon. Let's just use the 3 years ago
CONTRIBUTORS Update to what will likely be ksh in OpenBSD 6.5. 3 years ago
LEGAL Import oksh 7 years ago
NOTES Add check for confstr() and minimal portable implementation of it. 4 years ago
PROJECTS Sync with OpenBSD. Add configure check for -w flag; use it if your compiler has it. 4 years ago
README.md Release oksh-7.0 2 weeks ago
README.pdksh Update to latest OpenBSD ksh code. Add Cygwin support. 4 years ago
alloc.c Update to latest upstream code. 4 years ago
asprintf.c Make cross compiling a real possibility, with instructions. 1 year ago
c_ksh.c Pull in all ksh changes up to 2 years ago
c_sh.c Update to latest OpenBSD code. 1 year ago
c_test.c Pull in all ksh changes up to 2 years ago
c_test.h Import oksh 7 years ago
c_ulimit.c Pull in all ksh changes up to 2 years ago
charclass.h Post-6.8, cclasses was made const. Let's chase that. 12 months ago
config.h Update to latest code. 4 years ago
configure Use old conversion of clock_gettime if on Mac OS X prior to 10.12 5 months ago
confstr.c Add check for confstr() and minimal portable implementation of it. 4 years ago
dot.profile Let's ship the default ksh.kshrc. 11 months ago
edit.c Add Haiku support. 1 year ago
edit.h We're approaching OpenBSD 6.4 now; this is close to what will be 3 years ago
emacs.c Sync from OpenBSD 4 months ago
eval.c This is oksh-6.8 12 months ago
exec.c Pull in all ksh changes up to 2 years ago
expand.h Convert GNU make to a configure script and POSIX make. 4 years ago
expr.c Update to what will likely be ksh in OpenBSD 6.5. 3 years ago
history.c Update to latest ksh code; fixes a hard failure with history. 2 years ago
io.c CVSROOT: /cvs 2 years ago
issetugid.c Code consistency 8 months ago
jobs.c Update to latest OpenBSD code. 1 year ago
ksh.1 Sync from OpenBSD 4 months ago
ksh.kshrc Let's ship the default ksh.kshrc. 11 months ago
lex.c Update to latest code. 4 years ago
lex.h Update to latest code. 4 years ago
mail.c Update to what will likely be ksh in OpenBSD 6.5. 3 years ago
main.c Release oksh-7.0 2 weeks ago
misc.c Post-6.8, cclasses was made const. Let's chase that. 12 months ago
oksh.1 Sync from OpenBSD 4 months ago
path.c Pull in all ksh changes up to 2 years ago
portable.h Use old conversion of clock_gettime if on Mac OS X prior to 10.12 5 months ago
reallocarray.c Check for pledge in configure. Lets oksh build on old versions of OpenBSD. 4 years ago
sh.1 Sync from OpenBSD 4 months ago
sh.h Update to latest OpenBSD code. 1 year ago
shf.c Pull in all ksh changes up to 2 years ago
shf.h Update to latest OpenBSD ksh code. Add Cygwin support. 4 years ago
siglist.c Build oksh with musl-libc (checked with Alpine Linux). 4 years ago
signame.c Solaris has a function named sig2str. Rename ours oksh_sig2str. 1 year ago
strlcat.c Check for pledge in configure. Lets oksh build on old versions of OpenBSD. 4 years ago
strlcpy.c Check for pledge in configure. Lets oksh build on old versions of OpenBSD. 4 years ago
strtonum.c Add fallback LLONG_MAX and LLONG_MIN defines to strtonum.c 2 years ago
syn.c Sync with OpenBSD 4 months ago
sys-queue.h Have all OS's always use portability queue routines. 3 years ago
table.c Update to latest upstream code. 4 years ago
table.h We're approaching OpenBSD 6.4 now; this is close to what will be 3 years ago
trap.c Set up siglist manually if we're on Linux. 12 months ago
tree.c Update to latest ksh(1) code. This changes all use of long to 4 years ago
tree.h Update to latest OpenBSD ksh code. Add Cygwin support. 4 years ago
tty.c Pull in all ksh changes up to 2 years ago
tty.h Update to latest OpenBSD ksh code. Add Cygwin support. 4 years ago
unvis.c Check for pledge in configure. Lets oksh build on old versions of OpenBSD. 4 years ago
var.c Update to latest OpenBSD code. 8 months ago
version.c Import oksh 7 years ago
vi.c Pull in another OpenBSD commit originally reported by @netzbasis 7 months ago
vis.c Check for pledge in configure. Lets oksh build on old versions of OpenBSD. 4 years ago
vis.h Build oksh with musl-libc (checked with Alpine Linux). 4 years ago

README.md

oksh

Portable OpenBSD ksh(1). Not an official OpenBSD project.

Why?

Because all operating systems deserve a good shell.

Unlike other ports of OpenBSD ksh, this port is entirely self-contained and aims to be maximally portable across operating systems and C compilers. We are always looking for new combinations to add support for.

Supported systems

oksh is known to run on the following Operating Systems:

  • OpenBSD
  • FreeBSD
  • DragonFly BSD
  • NetBSD
  • HardenedBSD
  • SoloBSD (as the default shell)
  • Mac OS X (port originally by @geoff-nixon)
  • Linux (glibc and musl)
  • Cygwin
  • Android (via Termux)
  • AIX (with major thanks to @tssva and @NattyNarwhal)
  • IBM i PASE
  • Solaris
  • Illumos
  • midipix
  • WSL
  • WSL2
  • Unixware 7
  • Haiku
  • HP-UX (gcc only)
  • SerenityOS

Running on a system not listed here? Add it and send a pull request!

Believed working

We believe that oksh will work on the following platforms, but testing is needed. Help is greatly appreciated and encouraged!

  • Irix

Supported compilers

oksh is known to build with the following C compilers:

Building with a compiler not listed here? Add it and send a pull request!

Packages

oksh is included in some package systems.

Packaging status

In addition, there are some unofficial packages:

Using a package not listed here? Add it and send a pull request!

Dependencies

A C99 compiler is the easiest way to ensure that oksh will build correctly. Please see the list of C compilers above for a list of known working compilers.

Though not required, the ncurses library will be used for screen clearing routines if the library is found during the configure stage. This can be turned off by the user by passing the --disable-curses flag to configure.

A configure script that produces a POSIX Makefile is provided to ease building and installation and can be run by:

$ ./configure
$ make && sudo make install

Cross compiling

Cross compiling can be achieved by running configure as follows:

CC=/path/to/cross/cc CFLAGS="any needed cflags" LDFLAGS="any needed ldflags" ./configure --no-thanks

This will skip all configure checks and write out a generic Makefile and pconfig.h with nearly no options turned on. If using a cross gcc or clang, this very well may just work (with all compat compiled in). You can edit these files to reflect your system before running make.

All environment variables and configure flags are respected when using --no-thanks. Further specifying --no-link after --no-thanks will only compile the source files into object files, to be transfered onto the target machine and linked there.

The --no-thanks flag can also be used to compile a native oksh with all the compatibility functions compiled in, rather than relying on the system's version of those functions.

Submitting patches

Patches that add new platforms and improve support for existing platforms are always welcome.

Patches that cause oksh to deviate from upstream OpenBSD ksh behavior are better suited to be sent to the OpenBSD tech@ mailing list. Please make sure to test your patch on an OpenBSD machine first before submitting it to tech@. I will sync with the upstream OpenBSD code once your patch is accepted. If you'd like to open an issue here to track progress of your patch on tech@, that's fine.

License

The main Korn shell files are public domain (see LEGAL). Portability files are BSD or ISC licensed; see individual file headers for details.

Get a tarball

See releases tab. The latest release is oksh-7.0, which matches the ksh(1) from OpenBSD 7.0, released October 14, 2021.