Coder Social home page Coder Social logo

ksh's Introduction

ksh port

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)

Installation

Homebrew on macOS

Just do it, you know you want to:

$ brew install tamentis/core/openbsd-ksh

Ubuntu

$ sudo apt-get update
$ sudo apt-get install make gcc libc-dev ncurses-dev

Then continue with the generic instructions below.

Centos

$ sudo yum install gcc make ncurses-devel

Then continue with the generic instructions below.

Unix-y, from source

$ ./configure
$ make
$ sudo make install

What's missing

  • 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.

Changelog

6.5

  • 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.

6.4

  • Support 64 bit integers on 32 bit architectures.

6.3

  • 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.

6.2

  • Improved UTF-8 line editing support for Emacs and Vi input mode.

6.1

  • Partial UTF-8 line editing support for Vi input mode.

6.0

  • Improve various details of POSIX compliance.

5.9

  • Partial support for inserting and deleting UTF-8 characters in emacs command line editing mode.

Disclaimer

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.

Refresh

Via CVS:

  1. clone the repo for whatever branch you want:
$ cvs -d [email protected]:/cvs co -rOPENBSD_6_3 src/bin/ksh
  1. hack away, diff, incorporate
  2. pull request?

Via the GitHub clone:

  1. Clone the clone:
git clone https://github.com/openbsd/src
  1. 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

ksh's People

Contributors

botovq avatar brynet avatar ischwarze avatar jcourreges avatar klemensn avatar nicm avatar sebastianbenoit avatar skotchandsoda avatar tamentis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ksh's Issues

mknod.c major/minor compile erros on Fedora

I compiled this on Fedora 32 (new install) and found the below compile errors. The patch following the errors resolved them.

mknod.c:69:6: error: called object ‘major’ is not a function or function pointer
69 | if (major(dev) != major || minor(dev) != minor) {
| ^~~~~
mknod.c:47:8: note: declared here
47 | u_int major, minor;
| ^~~~~
mknod.c:69:29: error: called object ‘minor’ is not a function or function pointer
69 | if (major(dev) != major || minor(dev) != minor) {
| ^~~~~
mknod.c:47:15: note: declared here
47 | u_int major, minor;
| ^~~~~

This patch resolved them.
$ git diff
diff --git a/src/mknod.c b/src/mknod.c
index 2e336a7..1092d36 100644
--- a/src/mknod.c
+++ b/src/mknod.c
@@ -35,6 +35,7 @@

#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <errno.h>

#include "sh.h"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.