.; CSICMD.IND - Control file to provide wild card file specifications .; in programs which don't accept them. .; This version prepares files to be run in CSI mode. .; .; The file is invoked by IND CSICMD P1 P2 P3 P4 P5, where: .; .; P1 - The Program [/Directory_switches] .; P2 - The Input Filespec[/File_switches] .; P3 - The Output Filespec .; P4 - Execute switch .; P5 - Delete .COM file switch .; .; Directory_switches are any legal switch for the DIRECTORY command. .; File_switches are switches to be applied to an input filespec, .; such as for TRANSF INFIL/T ... .; The Output Filespec may have switches appended to it. .; Since the main use of this command file will probably be to provide .; wild-card filespec functionality for TRANSF, the output file string .; will be treated as follows: .; If a complete filespec is given (DEV:FILE.EXT), the output .; files will use the DEV and EXT provided. .; If only the device is given (DEV:), the output files will .; be DEV:Inp_File.Inp_Ext. .; If only a File (or *) is given, the output files will be .; DK:Inp_File.Inp_Ext. .; If the Execute switch has the value "EXE", the command will be .; executed; otherwise this file will only build a command file to .; be executed later. .; If the Delete switch has the value "DEL", the .COM file will be .; deleted after execution. The delete command is included in the .; command file itself, so the command file may be prepared on a .; "remote" system, and then shipped to a "host" system and executed .; (and then deleted from the host system). .; .; See the documentation file CMDIND.DOC for examples of how to use .; CSICMD for uploading and downloading files using TRANSF. .; .; It is necessary to assign some device to be WF:. .; It is necessary that the file PARSE.IND be located on SY:. .; .; Written by: .; R. W. Barnard .; BIO/Comp Applications .; Albuquerque, NM 87185 .; .; Version 1.08, 29-Jan-88. .; .enable quiet .enable global .disable lowercase .disable prefix, suffix .enable escape .; .sets $DEFDV "DK:" .sets $DEFXT ".*" .;Any extension. .setf INTRAC .;Indicates if input has been interactive. .; .testdevice WF: .test "NSD" .if ne 0 .goto nodev .; .start: .sets RAWCMD P1 .;Get the command if not entered on .if RAWCMD ne "" .goto p10 .;command line. .asks P1 Enter the program name [/Directory_switches]: .sett INTRAC .goto start .; .p10: .parse RAWCMD "/" COMAND DIRSWS .sets LINE1 "r 'COMAND'" .;The command to be run. .open #2 WF:'COMAND'.COM .data #2 'LINE1' .close #2 .; .if DIRSWS eq "" .goto filesp .sets DIRSWS "/"+DIRSWS .; .filesp: .sets RAWFIL P2 .if RAWFIL ne "" .goto d10 .;Get the input file. .asks P2 Enter the input filespec(s) [/File_switches]: .sett INTRAC .goto filesp .; .d10: .parse RAWFIL "/" FILSPC FILSWS @SY:PARSE.IND 'FILSPC' .sets IDEV $DEV .;Input device name. .parse $FILNM "." FILNAM $DEFXT .if FILSWS eq "" .goto d20 .;Save these switches to apply to .sets FILSWS "/"+FILSWS .;the final input filespec. .d20: DIR/BRI/COL:1/OUT:WF:CMD.TMP'DIRSWS' '$FILSP' .; .target: .sets OUTFIL P3 .if OUTFIL ne "" .goto t20 .asks P3 Enter the output filespec: .sett INTRAC .goto target .; .t20: .parse OUTFIL "/" OUTFIL OUTSWS .; Parse the output filespec without getting physical device name. @SY:PARSE.IND 'OUTFIL' 1 .sets ODEV $DEV .parse $FILNM "." OFILE $EXT .if $EXT eq "*" .sets $EXT "" .sets OEXT $EXT .; .if OUTSWS eq "" .goto t30 .sets OUTSWS "/"+OUTSWS .; .t30: .openr WF:CMD.TMP .read LINE .rdloop: .read LINE .test LINE "." .if eq 0 .goto execut .;We have read everything of interest. .parse LINE "." FILNAM EXT .test FILNAM " " .if eq 0 .goto d30 .;Need to trim trailing blanks. .sets FILNAM FILNAM[1:-1] .; .d30: .sets ILINE IDEV+FILNAM+"."+EXT+FILSWS .;This is the input string. .if $EXT eq "" .sets OEXT EXT .sets OLINE ODEV+FILNAM+"."+OEXT+OUTSWS+"=" .;This is the output filespec. .sets CMDLIN OLINE+ILINE .opena #2 WF:'COMAND'.COM .data #2 'CMDLIN' .close #2 .goto rdloop .; .execut: .sets DELCMD "" .sets DELETE P5 .if DELETE eq "DEL" .sets DELCMD "DEL/NOQ WF:'COMAND'.COM" .; .opena #2 WF:'COMAND'.COM .data #2 ^C .data #2 'DELCMD' .close #2 .close .iff INTRAC .goto e20 .ask Q Do you want to execute this command now [N]: .ift Q .sets P4 "EXE" .; .e20: .sets EXECUT P4 .if EXECUT ne "EXE" .goto e30 $@WF:'COMAND'.COM .goto e40 .; .e30: ; ;The file WF:'COMAND'.COM may be executed when you wish .; .e40: DEL/NOQ WF:CMD.TMP .; .exit .; .nodev: ; ;The device WF: has not been assigned! .exit