10
20
30 :
40 in%=0:out%=0:DIMctrl%31,data%79:A$=FNOS_GetEnv:CommandLine$=A$
50 quit$=FNcl(" -q",1):ONERRORIFFNerr:PROCexit(ERR):END
60 debug%=FNcl("-d",0):lp$=FNcl("-l",1):tt$=FNcl("-4",1):spool%=FNcl("-s",0)
70 spool%=FNcl("-s",0):
80 debug%=TRUE
90 :
100 IFdebug%:PRINT"RunCommand= '"run$"'"'"CommandLine='"CommandLine$"'"'"quit$='"quit$"'"'"debug%=";debug%,"spool%=";spool%'"lp$='"lp$"'"TAB(20)"tt$='"tt$"'"
110 IFFNcl("-?",0):PRINT"Syntax: Shell (-debug) (-lp <fname>) (-4 <fname>) <afsp> (-quit <fname>)":PROCexit(0):END
120 :
130 CallBack$="":IFrun$<>"":CallBack$=" -quit "+run$+" "+CommandLine$
140 ONERRORIFFNerr:PROCexit(ERR):END
150 REPEATA%=1:X%=0:ReturnValue%=((USR&FFF4)AND&FF00)DIV256
160 IFReturnValue%:PRINT"ReturnValue=";ReturnValue%
170 INPUTLINE"$ "A$
180 IFASCA$<>42 ANDA$<>"":A$=A$+CallBack$
190 PROCos(A$):UNTILFALSE:END
200 :
210 DEFFNerr:REPORT:PRINT:=INKEY-1