loadPackage OK for extension/stringChunk.cls
loadPackage OK for utilities/indentedStream.cls
loadPackage OK for extension/extensions.cls
loadLibrary OK for rxunixsys
loadPackage OK for ncurses.cls
loadPackage OK for csvStream.cls
loadLibrary OK for hostemu
loadPackage OK for json.cls
loadPackage OK for mime.cls
loadPackage OK for rxftp.cls
loadLibrary OK for rxmath
loadPackage OK for rxregexp.cls
loadPackage OK for regex/regex.cls
loadPackage OK for smtp.cls
loadPackage OK for socket.cls
loadPackage OK for streamsocket.cls
loadPackage OK for pipeline/pipe.cls
loadPackage OK for rgf_util2/rgf_util2.rex
loadPackage OK for BSF.CLS
loadPackage OK for oorexxshell_queries.cls
loadPackage OK for pipeline/pipe_extension.cls
loadPackage OK for rgf_util2/rgf_util2_wrappers.rex

REXX-ooRexx_4.3.0(MT)_64-bit 6.04 1 Mar 2026
Input queue name: SbafaQ6000019d5c70

--------------
-- ooRexxShell
--------------

/*
ooRexxShell, derived from rexxtry.
*/

/*
This shell supports several interpreters:
- ooRexx itself
- the system address (cmd under Windows, sh or bash under Linux and MacOs)
- PowerShell core (pwsh)
- any other external environment (you need to modify ooRexxShell, search for hostemu for an example).
*/

/*
The prompt indicates which interpreter is active.
By default the shell is in ooRexx mode: ooRexx[bash]>
When the interpreter is ooRexx, the value of address() is displayed between [].
*/
ooRexx[bash]> say "hello"
hello
ooRexx[bash]> say 1+2
3
ooRexx[bash]> 
/*
If an ooRexx clause ends with "=" then the clause is transformed to display the result :
'1+2=' becomes 'options "NOCOMMANDS"; 1+2 ; call dumpResult; options "COMMANDS"'
'=' alone displays the current value of the variable RESULT.
*/
ooRexx[bash]> 1+2=
 3
ooRexx[bash]> (1,2)=          -- When "=" then the arrays are displayed in condensed form
[ 1, 2]
ooRexx[bash]> (1,2)==         -- When "==" then the arrays are displayed one item per line
an Array (shape [2], 2 items)
 1 :  1
 2 :  2
ooRexx[bash]> 
/*
You have access to Java.
*/
ooRexx[bash]> jsystem = bsf.loadClass('java.lang.System')
ooRexx[bash]> properties = jsystem~getProperties
ooRexx[bash]> enum = properties~propertyNames
ooRexx[bash]> do while enum~hasMoreElements; key=enum~nextElement; say "key:" left("["key"]",30) "value: ["properties~getProperty(key)"]"; end
key: [java.runtime.name]            value: [OpenJDK Runtime Environment]
key: [java.vm.version]              value: [23.0.2+9]
key: [sun.boot.library.path]        value: [/Users/Shared/local/java/jdk/bellsoft/jdk-23.0.2-full.jdk/lib]
key: [java.vm.vendor]               value: [BellSoft]
key: [java.vendor.url]              value: [https://bell-sw.com/]
key: [path.separator]               value: [:]
key: [java.vm.name]                 value: [OpenJDK 64-Bit Server VM]
key: [user.country]                 value: [FR]
key: [java.vm.specification.name]   value: [Java Virtual Machine Specification]
key: [user.dir]                     value: [/Users/Shared/local/rexx/oorexx/executor/sandbox/jlf/demos]
key: [java.vm.compressedOopsMode]   value: [Zero based]
key: [java.runtime.version]         value: [23.0.2+9]
key: [os.arch]                      value: [aarch64]
key: [java.io.tmpdir]               value: [/var/folders/f6/ls9l793n1bg444403jmfh1_m0000gp/T/]
key: [line.separator]               value: [
]
key: [java.vm.specification.vendor] value: [Oracle Corporation]
key: [stderr.encoding]              value: [UTF-8]
key: [os.name]                      value: [Mac OS X]
key: [sun.jnu.encoding]             value: [UTF-8]
key: [stdout.encoding]              value: [UTF-8]
key: [java.library.path]            value: [/Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/delivery/lib:/local/rexx/bsf4oorexx/BSF4ooRexx_install_v641-20221002-refresh/bsf4oorexx/lib:/local/rexx/bsf4oorexx/BSF4ooRexx_install_v641-20221002-refresh/bsf4oorexx/lib/macos-arm64::]
key: [jdk.debug]                    value: [release]
key: [java.class.version]           value: [67.0]
key: [java.specification.name]      value: [Java Platform API Specification]
key: [sun.management.compiler]      value: [HotSpot 64-Bit Tiered Compilers]
key: [os.version]                   value: [15.7.3]
key: [http.nonProxyHosts]           value: [local|*.local|169.254/16|*.169.254/16]
key: [user.home]                    value: [/Users/jlfaucher]
key: [user.timezone]                value: [Europe/Paris]
key: [file.encoding]                value: [UTF-8]
key: [java.specification.version]   value: [23]
key: [user.name]                    value: [jlfaucher]
key: [java.class.path]              value: [/local/rexx/bsf4oorexx/BSF4ooRexx_install_v641-20221002-refresh/bsf4oorexx/bsf4ooRexx-v641-20221002-bin.jar:]
key: [java.vm.specification.version value: [23]
key: [sun.arch.data.model]          value: [64]
key: [java.home]                    value: [/Users/Shared/local/java/jdk/bellsoft/jdk-23.0.2-full.jdk]
key: [user.language]                value: [en]
key: [java.specification.vendor]    value: [Oracle Corporation]
key: [java.vm.info]                 value: [mixed mode, sharing]
key: [java.version]                 value: [23.0.2]
key: [native.encoding]              value: [UTF-8]
key: [java.vendor]                  value: [BellSoft]
key: [java.awt.headless]            value: [true]
key: [file.separator]               value: [/]
key: [java.version.date]            value: [2025-01-21]
key: [java.vendor.url.bug]          value: [https://bell-sw.com/support]
key: [sun.io.unicode.encoding]      value: [UnicodeBig]
key: [sun.cpu.endian]               value: [little]
key: [socksNonProxyHosts]           value: [local|*.local|169.254/16|*.169.254/16]
key: [ftp.nonProxyHosts]            value: [local|*.local|169.254/16|*.169.254/16]
ooRexx[bash]> 
/*
A shell command can be used in ooRexx mode, surrounded with quotes.
*/
ooRexx[bash]> 'ls -lap *demo*.txt'
-rw-r--r--@ 1 jlfaucher  wheel    1263 Mar  3 18:15 _readme-demos.txt
-rw-r--r--@ 1 jlfaucher  wheel    8855 Jun 22  2024 executor-demo-array-output.txt
-rw-r--r--@ 1 jlfaucher  wheel  305774 May 31  2023 executor-demo-classic_rexx-output.txt
-rw-r--r--@ 1 jlfaucher  wheel   57250 Jun 22  2024 executor-demo-extensions-output.txt
-rw-r--r--@ 1 jlfaucher  wheel   43331 Mar  4 01:25 executor-demo-text-compatibility-auto-conv-output.txt
-rw-r--r--@ 1 jlfaucher  wheel   43474 Mar  4 01:25 executor-demo-text-compatibility-output.txt
-rw-r--r--@ 1 jlfaucher  wheel   23941 Mar  4 01:25 executor-demo-text-internal_checks-output.txt
-rw-r--r--@ 1 jlfaucher  wheel   22371 Mar  4 01:25 executor-demo-text-output.txt
-rw-r--r--@ 1 jlfaucher  wheel   54577 Mar  4 01:25 executor-demo-text-unicode-output.txt
-rw-r--r--@ 1 jlfaucher  wheel    5514 Mar  3 23:28 ooRexxShell-demo-helpers-output.txt
-rw-r--r--@ 1 jlfaucher  wheel   16023 Jun 22  2024 ooRexxShell-demo-interpreters-output.txt
-rw-r--r--@ 1 jlfaucher  wheel  538730 Mar  4 06:28 ooRexxShell-demo-queries-output.txt
ooRexx[bash]> 
/*
When not in ooRexx mode, you enter raw commands that are passed directly to the external environment.
You switch from an interpreter to an other one by entering its name alone.
To get the list of all interpreter names, enter this command:
?i[nterpreters]
Under Linux & MacOs, this list includes the shells in /etc/shells.
*/
ooRexx[bash]> ?interpreters
Interpreters:
    bash: to activate the bash interpreter.
    cmd: to activate the sh interpreter.
    command: to activate the sh interpreter.
    csh: to activate the csh interpreter.
    hostemu: to activate the HostEmu interpreter.
    ksh: to activate the ksh interpreter.
    oorexx: to activate the ooRexx interpreter.
    pwsh: to activate the pwsh interpreter.
    screen: to activate the screen interpreter.
    sh: to activate the sh interpreter.
    system: to activate the sh interpreter.
    tcsh: to activate the tcsh interpreter.
    zsh: to activate the zsh interpreter.
[Info] 14 lines displayed
ooRexx[bash]> 
/*
'cmd' 'command' and "system" are aliases to select the system interpreter.
*/
ooRexx[bash]> system
sh> 
/*
Now the default interpreter is the system shell.
No need to surround the commands with quotes.
*/
sh> ls -lap *demo*.cast
-rw-r--r--@ 1 jlfaucher  wheel   44582 Jun 22  2024 executor-demo-array.cast
-rw-r--r--@ 1 jlfaucher  wheel  374800 May 31  2023 executor-demo-classic_rexx.cast
-rw-r--r--@ 1 jlfaucher  wheel  125281 Jun 22  2024 executor-demo-extensions.cast
-rw-r--r--@ 1 jlfaucher  wheel  268857 Mar  4 01:25 executor-demo-text-compatibility-auto-conv.cast
-rw-r--r--@ 1 jlfaucher  wheel  281947 Mar  4 00:54 executor-demo-text-compatibility.cast
-rw-r--r--@ 1 jlfaucher  wheel  123472 Mar  4 00:10 executor-demo-text-internal_checks.cast
-rw-r--r--@ 1 jlfaucher  wheel  171525 Mar  4 00:22 executor-demo-text-unicode.cast
-rw-r--r--@ 1 jlfaucher  wheel   93762 Mar  4 00:01 executor-demo-text.cast
-rw-r--r--@ 1 jlfaucher  wheel   11092 Mar  3 23:28 ooRexxShell-demo-helpers.cast
-rw-r--r--@ 1 jlfaucher  wheel   19808 Mar  4 06:30 ooRexxShell-demo-interpreters.cast
-rw-r--r--@ 1 jlfaucher  wheel  667133 Mar  4 06:28 ooRexxShell-demo-queries.cast
sh> 
/*
HostEmu is a subcommand environment that partially emulates a TSO/CMS environment.
*/
sh> hostemu
HostEmu> 
/*
Now the default interpreteur is HostEmu.
No need to surround the commands with quotes.
*/
HostEmu> 
/*
EXECIO is an I/O mechanism.
The following command will read the 10 first lines from the file "_readme-demos.txt".
They are stored in the stem named "lines.".
*/
HostEmu> execio 10 diskr "_readme-demos.txt" (finis stem lines.
HostEmu> 
/*
When in HostEmu mode, the ooRexx expressions are not recognized
*/
HostEmu> lines.=
hostemu: bad PLIST, token "syntax error"
RC= 24
HostEmu> 
/*
You can switch temporarily to ooRexx to display the result.
For that, start your command line with "oorexx".
*/
HostEmu> oorexx lines.=
a Stem (11 items)
 0  :  10
 1  : 'Demonstration scripts.'
 2  : 'ooRexxShell has a demo mode with slow display.'
 3  : ''
 4  : 'https://asciinema.org/              asciinema   Terminal session recorder'
 5  : 'https://github.com/theZiz/aha       aha         Ansi HTML Adapter.'
 6  : ''
 7  : 'Current demos:'
 8  : 'executor-demo-array.rex'
 9  : 'executor-demo-classic_rexx.rex'
 10 : 'executor-demo-extensions.rex'
HostEmu> 
/*
Switch to PowerShell core.
pwsh
*/
HostEmu> pwsh
pwsh> 
/*
Now the default interpreter is pwsh.
No need to surround the commands with quotes.
*/

/*
Find the commands containing "rexx":
*/
pwsh> get-command *rexx* | select -property name, source

Name                    Source
----                    ------
oorexxshell             /local/rexx/oorexx/executor/incubator/ooRexxShell/oorexxshell
oorexxshell.rex         /local/rexx/oorexx/executor/incubator/ooRexxShell/oorexxshell.rex
oorexx_collect_docfiles /Users/Shared/local/rexx/builder/scripts/oorexx_collect_docfiles
oorexx_vars             /Users/Shared/local/rexx/builder/scripts/oorexx_vars
rexx                    /Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/delive…
rexx.cat                /Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/delive…
rexx.img                /Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/delive…
rexxc                   /Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/delive…
rexxscriptlib.rex       /Users/Shared/local/rexx/builder/scripts/rexxscriptlib.rex
rexxtry.rex             /Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/delive…
setenv-oorexx           /Users/Shared/local/rexx/builder/scripts/setenv-oorexx
setenv-rexx             /Users/Shared/local/rexx/builder/scripts/setenv-rexx
setenv-rexxlocal        /Users/Shared/local/rexx/builder/scripts/setenv-rexxlocal
testOORexx.rex          /local/rexx/oorexx/official/test/trunk/testOORexx.rex

pwsh> 
/*
Same command, send the output to the rexx queue without the table headers.
The empty lines are still in the output, they will be filtered on ooRexx side.
*/
pwsh> get-command *rexx* | select -property name, source | format-table -HideTableHeaders | rxqueue
pwsh> 
/*
Collect the lines of the rexx queue in an array, and then parse the lines to create an ooRexx directory.
*/
pwsh> oorexx .rexxqueue~new~makearray~select{item <> ""}~reduce(.directory~new){parse value item~space with name source; accu[name]=source}=
a Directory (14 items)
'oorexxshell'             : '/local/rexx/oorexx/executor/incubator/ooRexxShell/oorexxshell'
'oorexxshell.rex'         : '/local/rexx/oorexx/executor/incubator/ooRexxShell/oorexxshell.rex'
'oorexx_collect_docfiles' : '/Users/Shared/local/rexx/builder/scripts/oorexx_collect_docfiles'
'oorexx_vars'             : '/Users/Shared/local/rexx/builder/scripts/oorexx_vars'
'rexx'                    : '/Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/deliver…'
'rexx.cat'                : '/Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/deliver…'
'rexx.img'                : '/Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/deliver…'
'rexxc'                   : '/Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/deliver…'
'rexxscriptlib.rex'       : '/Users/Shared/local/rexx/builder/scripts/rexxscriptlib.rex'
'rexxtry.rex'             : '/Users/Shared/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos-arm64/clang/release/deliver…'
'setenv-oorexx'           : '/Users/Shared/local/rexx/builder/scripts/setenv-oorexx'
'setenv-rexx'             : '/Users/Shared/local/rexx/builder/scripts/setenv-rexx'
'setenv-rexxlocal'        : '/Users/Shared/local/rexx/builder/scripts/setenv-rexxlocal'
'testOORexx.rex'          : '/local/rexx/oorexx/official/test/trunk/testOORexx.rex'
pwsh> 
/*
Back to the ooRexx interpreter, by entering "oorexx" alone.
*/
pwsh> oorexx
ooRexx[bash]> say "The default interpreter is now ooRexx"
The default interpreter is now ooRexx
ooRexx[bash]> 
/*
End of demonstration.
*/