home *** CD-ROM | disk | FTP | other *** search
- /*=======================================================*/
- /* */
- /* Execute cli commands from within PowerVisor V1.1 */
- /* */
- /* © Jorrit Tyberghein 17 Sep 1991 V1.0 */
- /* 20 Jul 1992 V1.1 */
- /* */
- /*=======================================================*/
-
- options results
- parse arg cmd
- if cmd=='' then
- do
- 'print "Bad argument!\n"'
- exit
- end
-
- ti=pragma('Id')
-
- parse var cmd cmd rest
- address command cmd '>t:cmd'ti rest
- if rc~=0 then
- 'print "Warning: Command failed with returncode' rc '!\n"'
- if ~open(file,'t:cmd'ti,'R') then
- do
- address command 'delete t:cmd'ti' >nil:'
- 'print "Error opening file !\n"'
- exit
- end
-
- /* Prepare for interruption */
- 'assign stop'ti'=0'
- "attach 'stop"ti"=1' 51 8 e" /* ctrl-c */
- at = result
-
- line=readln(file)
- do while ~eof(file)
- 'print "·Å'line'Å\0a"'
- line=readln(file)
- 'void stop'ti
- if result==1 then
- do
- 'print "Break***\n"'
- leave
- end
- end
-
- 'remvar stop'ti
- 'remattach 'at
-
- call close file
- address command 'delete t:cmd'ti' >nil:'
- exit
-