A shell for those that prefer Macintosh Programmer's Workshop.
mpw
Go to file
Kelvin Sherlock f125b533f7 Squashed commit of the following:
commit f0944a89f27e44b1764988806e655f09764e80df
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:24:08 2016 -0400

    exit throws execution of input error w/ possible 0 value.  catch it.

commit 9e7f9c1ae049aa26513413f4767268b47ee22e98
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:23:21 2016 -0400

    builtins - more consistent argument handling.

commit be4c1c902f5a3a3f01e92ae52c7d6cc5d8731b65
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:23:01 2016 -0400

    .

commit 68d0c29fec112c6e7bc3a672b41eb7eb758a8941
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:22:51 2016 -0400

    exit command.

commit 25b0a7f7da9220b03026123bb5072c2da1d73fde
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:21:16 2016 -0400

    builtin quit command.
2016-08-30 12:25:43 -04:00
cxx PATH_MAX + 1 2016-08-09 14:47:11 -04:00
etc load UserStartup file. 2016-08-17 13:14:16 -04:00
.gitignore initial version 2016-01-27 10:43:34 -05:00
.travis.yml travis - make no longer needs to be installed. 2016-07-19 12:47:38 -04:00
builtins.cpp Squashed commit of the following: 2016-08-30 12:25:43 -04:00
builtins.h Squashed commit of the following: 2016-08-30 12:25:43 -04:00
CMakeLists.txt update the parser/lexer to make it more reusable. For example, subshells are now handled. 2016-08-16 16:47:20 -04:00
command.cpp Squashed commit of the following: 2016-08-30 12:25:43 -04:00
command.h Squashed commit of the following: 2016-08-30 12:25:43 -04:00
config.h.in generate config.h via CMake. 2016-08-09 15:29:10 -04:00
environment.cpp headers 2016-08-05 22:38:06 -04:00
environment.h lunix/gcc updates. 2016-08-05 22:00:48 -04:00
error.h Squashed commit of the following: 2016-08-30 12:25:43 -04:00
fdset.h implement pipe. 2016-07-26 16:07:44 -04:00
macroman.cpp shut up warning 2016-08-09 14:40:00 -04:00
macroman.h macroman / utf 8 conversions. 2016-07-23 15:21:13 -04:00
macroman.x macroman / utf 8 conversions. 2016-07-23 15:21:13 -04:00
make-version.rb version bump 2016-06-16 21:55:39 -04:00
mpw_parser.cpp Squashed commit of the following: 2016-08-30 12:25:43 -04:00
mpw_parser.h gcc/case sensitive fixes. 2016-08-17 13:14:38 -04:00
mpw-shell-expand.rl update the parser/lexer to make it more reusable. For example, subshells are now handled. 2016-08-16 16:47:20 -04:00
mpw-shell-parser.cpp clean up errors a little bit. 2016-07-28 13:42:18 -04:00
mpw-shell-quote.rl clean up must_quote a little bit, 2016-07-23 12:58:01 -04:00
mpw-shell-token.rl fix + / - confusion. 2016-08-11 16:09:39 -04:00
mpw-shell.cpp Squashed commit of the following: 2016-08-30 12:25:43 -04:00
mpw-shell.h update the parser/lexer to make it more reusable. For example, subshells are now handled. 2016-08-16 16:47:20 -04:00
mpw-shell.text initial version 2016-01-27 10:43:34 -05:00
pathnames.rl version bump 2016-06-16 21:55:39 -04:00
phase1.cpp update the parser/lexer to make it more reusable. For example, subshells are now handled. 2016-08-16 16:47:20 -04:00
phase1.h update the parser/lexer to make it more reusable. For example, subshells are now handled. 2016-08-16 16:47:20 -04:00
phase1.rl clean up whitespace coalesce a bit 2016-02-10 23:53:41 -05:00
phase2.h update the parser/lexer to make it more reusable. For example, subshells are now handled. 2016-08-16 16:47:20 -04:00
phase2.rl Squashed commit of the following: 2016-08-30 12:25:43 -04:00
phase3_parser.h update the parser/lexer to make it more reusable. For example, subshells are now handled. 2016-08-16 16:47:20 -04:00
phase3.lemon Squashed commit of the following: 2016-08-30 12:25:43 -04:00
README.md update readme a little more. 2016-07-26 20:22:38 -04:00
value.h initial version 2016-01-27 10:43:34 -05:00
value.rl initial version 2016-01-27 10:43:34 -05:00
version.h Bump Version: 0.3 2016-08-07 15:38:04 -04:00

MPW Shell

MPW Shell is a re-implementation of the Macintosh Programmer's Workshop shell. The primary reason is to support MPW Make (which generated shell script). It may also be useful for other things.

Supported features

  • If ... [Else If] ... [Else] ... End
  • Begin ... End
  • Loop ... End
  • For name In [word...] ... End
  • Break [If], Continue [If]
  • ( ... )
  • ||
  • &&
  • redirection
  • | "pipes" (via a temporary file. Presumably, that's what MPW did as well.)

Not (yet) supported

  • subshells (..., ...)
  • aliases
  • regular expressions
  • text-editing commands (search forward/backward, et cetera)

Builtin Commands

  • AboutBox
  • Alias
  • Catenate
  • Directory
  • Echo
  • Evaluate
  • Exists
  • Export
  • Parameters
  • Quote
  • Set
  • Shift
  • Unalias
  • Unexport
  • Unset
  • Version
  • Which

Setup

  1. Install MPW. The mpw binary should be somewhere in your $PATH. It also checks /usr/local/bin/mpw and $HOME/mpw/bin/mpw
  2. Copy the Startup script to $HOME/mpw/. This script is executed when mpw-shell (or mpw-make) starts up (imagine that) and should be used to set environment variables.