Martin,
Cube is a REXX script. However, if you really want to invent your own, a typical file read loop looks like:
/*=== DoReadFile(fileName) Read file and process code snippet ===*/
DoReadFile:
parse arg fileName
say 'Reading' fileName
call stream fileName, 'C', 'OPEN READ'
do while lines(fileName)
line = linein(fileName)
say line
end /* while lines */
call stream fileName, 'C', 'CLOSE'
return
/* end DoReadFile */
You will need to add logic to find the drive letter in the set statement, replace the drive letter and rewrite the statement in the file. Seems like a lot of work to me compared to reading the cube docs and figuring out how to change the vboxadd.wis line
EXECUTE="CONFIGSYS|cube { CL #DEVICE=?:\OS2\BOOT\MOUSE.SYS# WITH #rem# (ALL } ?:\CONFIG.SYS (DLM #"
to do what you need. The above changeline command changes the device statement to a rem. You can modify this to find the set statement in setenv.cmd. The result will be something like:
EXECUTE="cube { CL #SET CXXMAIN=C:\programs\ibmcxxo# WITH #SET CXXMAIN=$(1)# } $(1):\bin\setenv.cmd (DLM #"
The above is untested, but should be close to what you need.