SCOUG-Programming Mailing List Archives
Return to [ 31 |
October |
1998 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
Hi Greg,
You can invoke the command processor CMD.EXE and give it a command file
to execute (type HELP CMD at a command line prompt, and use the /C
parameter). The command file can include any piping you want. Make
sure "exit" is the very last command in the file.
I don't think you asked for a generic REXX filter, but I'll include the
one I use in case there's something in it you can swipe.
- Peter Skye
/* The FILTER.CMD Rexx program is a sample filter. It was taken from
RXTT28. */
/* Programmer's notes:
/ 1. Write all messages (error messages, logos, etc.) to STDERR
instead of STDOUT, e.g. use
/ call lineout 'STDERR', 'This is an error message'
/ 2. Always use
/ call trace 'OFF'
/ as the first statement in a filter program. This statement
makes sure that your program
/ ignores the environment variable RXTRACE.
/ 3. The function LINES() does not work as expected in
Object-Oriented REXX (it always returns
/ 0). Therefore, you must distinguish between the different REXX
versions in your filter
/ program.
/ 4. A filter program reads lines from STDIN and writes lines to
STDOUT.
/ */
/* Ignore the environment variable RXTRACE. */
call trace 'OFF'
/* 'SIGNAL ON NOTREADY NAME' catches the end-of-file condition. */
signal on notready name ProgramEnd
/* Check the REXX interpreter version. 'PARSE VERSION' is a REXX
command. */
parse version rexxVersion .
if rexxVersion = 'OBJREXX'
then do
/* Current REXX version is Object REXX. */
/* Main loop for Object REXX. */
/* (The loop is exited by a NOTREADY condition.) */
do forever
.output~lineout( .input~linein )
end
end
else do
/* Current REXX version is Classic REXX. */
/* Main loop for Classic REXX. */
do while lines( 'STDIN' ) <> 0
call lineout 'STDOUT', linein()
end
end
ProgramEnd:
exit 0
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 31 |
October |
1998 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|