mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2024-12-27 03:32:05 +00:00
A shell for those that prefer Macintosh Programmer's Workshop.
ce1a36eba5
eg: evaluate abc =~ /(abc)®4/ # sets the '@4' environment variable. evaluate abc !~ /[aA]bc/ MPW regular expressions are converted to c++11 std::regex regular expressions and evaluated. Sadly, the // regular expression syntax interferes with unix-paths (if the / count is odd). quoting or ∂-escaping the /s is therefore necessary. file globbing is not yet implemented. |
||
---|---|---|
.github/workflows | ||
cxx | ||
etc | ||
.gitignore | ||
.travis.yml | ||
builtins.cpp | ||
builtins.h | ||
CMakeLists.txt | ||
command.cpp | ||
command.h | ||
config.h.in | ||
environment.cpp | ||
environment.h | ||
error.h | ||
fdset.h | ||
lemon_base.h | ||
macroman.cpp | ||
macroman.h | ||
macroman.x | ||
make-version.rb | ||
mpw_parser.cpp | ||
mpw_parser.h | ||
mpw-regex.cpp | ||
mpw-regex.h | ||
mpw-shell-expand.rl | ||
mpw-shell-parser.cpp | ||
mpw-shell-quote.rl | ||
mpw-shell-token.rl | ||
mpw-shell.cpp | ||
mpw-shell.h | ||
mpw-shell.text | ||
pathnames.rl | ||
phase1.cpp | ||
phase1.h | ||
phase1.rl | ||
phase2.h | ||
phase2.rl | ||
phase3_parser.h | ||
phase3.cpp | ||
phase3.h | ||
phase3.lemon | ||
phase3.out | ||
README.md | ||
value.h | ||
value.rl | ||
version.h |
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
- 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. - 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
.