A shell for those that prefer Macintosh Programmer's Workshop.
mpw
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
Kelvin Sherlock 91590e92aa add missing (mostly macroman) operators 4 months ago
.github/workflows Update cmake-macos.yml 6 months ago
cxx open(O_CREATE) needs 3rd parameter. 2 years ago
etc load UserStartup file. 7 years ago
.gitignore initial version 7 years ago
.travis.yml Update .travis.yml 5 years ago
CMakeLists.txt add regular expression support for evaluate, if, etc. 4 months ago
README.md Add build instructions to Readme. 5 months ago
builtins.cpp script parameters, move shift to the environment 4 months ago
builtins.h builtin_help 7 years ago
command.cpp script parameters, move shift to the environment 4 months ago
command.h Squashed commit of the following: 7 years ago
config.h.in generate config.h via CMake. 7 years ago
environment.cpp script parameters, move shift to the environment 4 months ago
environment.h script parameters, move shift to the environment 4 months ago
error.h add regular expression support for evaluate, if, etc. 4 months ago
fdset.h implement pipe. 7 years ago
lemon_base.h include generated lemon++ parser code so lemon++ isn't needed. 2 years ago
macroman.cpp shut up warning 7 years ago
macroman.h macroman / utf 8 conversions. 7 years ago
macroman.x macroman / utf 8 conversions. 7 years ago
make-version.rb nl @ end. 7 years ago
mpw-regex.cpp add regular expression support for evaluate, if, etc. 4 months ago
mpw-regex.h add regular expression support for evaluate, if, etc. 4 months ago
mpw-shell-expand.rl add regular expression support for evaluate, if, etc. 4 months ago
mpw-shell-parser.cpp add missing (mostly macroman) operators 4 months ago
mpw-shell-quote.rl clean up must_quote a little bit, 7 years ago
mpw-shell-token.rl add missing (mostly macroman) operators 4 months ago
mpw-shell.cpp look for ~/mpw, /usr/share/mpw, /usr/local/mpw 7 years ago
mpw-shell.h add regular expression support for evaluate, if, etc. 4 months ago
mpw-shell.text initial version 7 years ago
mpw_parser.cpp Squashed commit of the following: 7 years ago
mpw_parser.h gcc/case sensitive fixes. 7 years ago
pathnames.rl std::move warning. 2 years ago
phase1.cpp add regular expression support for evaluate, if, etc. 4 months ago
phase1.h update the parser/lexer to make it more reusable. For example, subshells are now handled. 7 years ago
phase1.rl clean up whitespace coalesce a bit 7 years ago
phase2.h update the parser/lexer to make it more reusable. For example, subshells are now handled. 7 years ago
phase2.rl include trailing text with the ) token so redirection works correctly 4 months ago
phase3.cpp include generated lemon++ parser code so lemon++ isn't needed. 2 years ago
phase3.h include generated lemon++ parser code so lemon++ isn't needed. 2 years ago
phase3.lemon Squashed commit of the following: 7 years ago
phase3.out include generated lemon++ parser code so lemon++ isn't needed. 2 years ago
phase3_parser.h update the parser/lexer to make it more reusable. For example, subshells are now handled. 7 years ago
value.h initial version 7 years ago
value.rl initial version 7 years ago
version.h Bump Version: 0.4 7 years ago

README.md

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.