home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Magazin: Amiga-CD 1996 July
/
AMIGA_1996_7.BIN
/
patches
/
pagestream
/
3.0cfupdate
/
macros.lha
/
PLcmdshell.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-04-20
|
2KB
|
72 lines
/*
** $VER: CmdShell.rexx 1.0 ()
**
**
*/
options results
options failat 100
open('console', 'CON:0/11/640/50/PageLiner', 'RW')
writeln('console', 'Enter commands, "Q" to exit, "?" for help.')
address PAGELINER
/* loop until user exits */
do forever
/* get command string from user */
writech('console','CMD> ')
cmd=readln('console')
select
/* time to quit? */
when (upper(cmd) = "Q") then do
leave
end
/* need some help? */
when (cmd = "?") then do
writeln('console', 'Enter "<command> ?" to obtain a command''s template.')
writeln('console', 'Enter "HELP <command>" to obtain more help on a command.')
writeln('console', 'Enter "Q" or "Quit" to exit command shell.')
writeln('console', 'Enter "REXX <command>" to execute rexx commands.')
end
/* do nothing on empty lines */
when (cmd = "") then do
nop
end
/* whatsinaline */
otherwise do
/* if the commandstring starts with "rexx " interpret it as a rexx
instruction instead of a command */
if upper(left(cmd,5)) = "REXX " then do
interpret right(cmd,length(cmd) - 5)
end
else do
/* execute the command string */
cmd
/* if ok show the result, if any */
if RC == 0 then do
if result ~= "RESULT" then writeln('console', result)
if (upper(cmd) = "QUIT") then leave
end
else do
/* ERROR!!!! get fault string from MCEd */
writeln('console', '*** Error');
end
end
end
end
end
exit(0)