A shell for those that prefer Macintosh Programmer's Workshop.
mpw
Go to file
2022-11-25 16:02:27 -05:00
.github/workflows Update cmake-macos.yml 2022-09-25 13:19:26 -04:00
cxx open(O_CREATE) needs 3rd parameter. 2020-12-01 23:31:28 -05:00
etc
.gitignore
.travis.yml Update .travis.yml 2017-11-26 14:40:30 -05:00
builtins.cpp script parameters, move shift to the environment 2022-11-23 21:22:00 -05:00
builtins.h builtin_help 2016-10-08 09:54:06 -04:00
CMakeLists.txt add regular expression support for evaluate, if, etc. 2022-11-22 17:22:49 -05:00
command.cpp script parameters, move shift to the environment 2022-11-23 21:22:00 -05:00
command.h Squashed commit of the following: 2016-08-30 12:25:43 -04:00
config.h.in
environment.cpp script parameters, move shift to the environment 2022-11-23 21:22:00 -05:00
environment.h script parameters, move shift to the environment 2022-11-23 21:22:00 -05:00
error.h add regular expression support for evaluate, if, etc. 2022-11-22 17:22:49 -05:00
fdset.h
lemon_base.h include generated lemon++ parser code so lemon++ isn't needed. 2020-12-01 23:00:41 -05:00
macroman.cpp
macroman.h
macroman.x
make-version.rb nl @ end. 2016-09-24 12:49:10 -04:00
mpw_parser.cpp Squashed commit of the following: 2016-08-30 12:25:43 -04:00
mpw_parser.h
mpw-regex.cpp add regular expression support for evaluate, if, etc. 2022-11-22 17:22:49 -05:00
mpw-regex.h add regular expression support for evaluate, if, etc. 2022-11-22 17:22:49 -05:00
mpw-shell-expand.rl add regular expression support for evaluate, if, etc. 2022-11-22 17:22:49 -05:00
mpw-shell-parser.cpp add missing (mostly macroman) operators 2022-11-25 16:02:27 -05:00
mpw-shell-quote.rl
mpw-shell-token.rl add missing (mostly macroman) operators 2022-11-25 16:02:27 -05:00
mpw-shell.cpp look for ~/mpw, /usr/share/mpw, /usr/local/mpw 2016-10-08 09:55:31 -04:00
mpw-shell.h add regular expression support for evaluate, if, etc. 2022-11-22 17:22:49 -05:00
mpw-shell.text
pathnames.rl std::move warning. 2020-12-01 23:01:00 -05:00
phase1.cpp add regular expression support for evaluate, if, etc. 2022-11-22 17:22:49 -05:00
phase1.h
phase1.rl
phase2.h
phase2.rl include trailing text with the ) token so redirection works correctly 2022-11-23 18:18:32 -05:00
phase3_parser.h
phase3.cpp include generated lemon++ parser code so lemon++ isn't needed. 2020-12-01 23:00:41 -05:00
phase3.h include generated lemon++ parser code so lemon++ isn't needed. 2020-12-01 23:00:41 -05:00
phase3.lemon Squashed commit of the following: 2016-08-30 12:25:43 -04:00
phase3.out include generated lemon++ parser code so lemon++ isn't needed. 2020-12-01 23:00:41 -05:00
README.md Add build instructions to Readme. 2022-10-16 14:39:56 +02:00
value.h
value.rl
version.h Bump Version: 0.4 2016-09-24 12:51:24 -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], Exit [If]
  • ( ... )
  • ||
  • &&
  • Redirection
  • | "pipes" (via a temporary file. Presumably, that's what MPW did as well.)
  • Subshells (..., ...)

Not (yet) supported

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

Builtin Commands

  • AboutBox
  • Alias
  • Catenate
  • Directory
  • Echo
  • Evaluate
  • Execute
  • Exists
  • Export
  • Parameters
  • Quit
  • 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. You can use mpw-shell without it but only with builtin commands.
  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.

Command Line Flags

-D name=value  Define environment variable
-v             Be verbose (equivalent to -Decho=1)
-f             Ignore the Startup script
-c string      Execute string
-h             Display help

Build

Standard CMake build sequence:

mkdir build
cd build
cmake ..
make

After that, do the standard CMake install sequence in the same folder:

cmake --install

to install mpw-shell and mpw-make in /usr/bin/local.