| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| zregina-1.2.zip | 2024-05-20 | 5.0 kB | |
| readme.md | 2024-05-20 | 2.3 kB | |
| Totals: 2 Items | 7.2 kB | 3 | |
This package is a zsh loadable module, which allows Rexx programs to be executed by the Regina Rexx interpreter within the same process as zsh itself.
The advantages of this are:
- environment variables set by VALUE( 'ENVVAR', 'newvalue', 'ENVIRONMENT' ) stay set after the end of the execution of the Rexx program.
- the current working directory can be set permanently by the Rexx program
- a numeric return code from a Rexx program is passed back to zsh, and can be obtained via the $? variable.
This module creates a new zsh builtin called "zregina". The builtin is run from zsh as:
`zregina [-a] rexx.program [arguments]`
or
`zregina -h` (to display help)
`zregina -v` (to show the version of Regina loaded)
The optional -a switch, runs the specified "rexx.program" as a subroutine. See the "-a" switch documentation for the "regina" executable.
To install, download the source code for the version of zsh matching the installed version of zsh:
`zsh --version`
Assuming the version shown is "5.9", download zsh source Unpack the zsh source distribution:
`xz -d zsh-5.9.tar.xz`
Change to the "Src/Modules" directory within the source tree, and unzip this distribution there. Change back to the zsh source top directory and build and install zsh as per its installation instructions. Generally this is:
`cd ..`
`Util/preconfig`
`./configure`
`make`
This will create: Src/Modules/zregina.so (or Src/Modules/zregina.dylib on macOS) Assuming you have zsh 5.9 installed already you need to get the zregina shared library into the zsh modules directory. This will be something like /usr/lib/x86_64-linux-gnu/zsh/5.9. Run:
`find /usr/lib -name zsh -print`
As root:
`mkdir /usr/lib/x86_64-linux-gnu/zsh/5.9/hessling`
`cp Src/Modules/zregina.so /usr/lib/x86_64-linux-gnu/zsh/5.9/hessling`
Test that zregina works by running:
`zmodload -a hessling/zregina zregina`
`zregina -v`
Once the zregina module has been installed and is working, add the following line to your $(HOME)/.zshrc:
zmodload -a hessling/zregina zregina
and the zregina module will be autoloaded each time you start zsh.