At the moment it's pretty much the same for different operating systems.
It's a 4NT command, using EXTPROC to a rexx script (weave.rex). Weave itself is a home-grown command processor, based on the notion that lots of documentation can be included in the code, without causing this to spill into the output files. The source for weave.rex is written in a miniture version of weave.rex.
The particular file shows the distribution of files to different copies of 4nt and tcmd (8.01), for both Windows 2K (on g:\) and XP (on h:). This version of 4nt/tcmd can operate out of the same directory, but different versions are kept for different operating systems.
Variables beginning in Y or Z in the rexx code can be directly used in the command, you can only !set variables in Y, though. !inc includes the code under the label. !new writes a new file for output, and !put puts an evaluated string to the command line.
For evaluation, strings are qTextqMoreqq, where q is the opening character (usually #) and a repetition of that character sets a line-end. Strings in Y or Z are tested for known values first.
In the example below, i write aliases for 4NT and TCMD for both Win2k and WinXP. The main differences are that the files are in different locations, and that 4NT and TCMD use different file names (TCSTART.BTM etc). Different aliases may be needed for different processors, so eg "fcw", a text-based norton commander clone for OS/2 and Windows, is not particularly relevant in TCMD, so it could have a special startup.
One can see, eg in the aliases section that "user:" is set differently for different instances of the operating systems. The line !put #user:=#yuser## is evaluated to user:=g:\users\wendy for 2K and k:\user\wendy for XP. Were there a need for desktop, we might put !put @desk:=@yuser@\desktop@@ for both. (the field character is the first one, "zhash" will create such a character if used. ZNUL or ZNULL creates an empty field.
Code:
extproc weave.rex
!src
!rem ; win 2k on g:
!set yuser #g:\users\wendy##
!set ypath #g:\save\newin\jpsoft##
!inc jpbtms ; winxp on h:
!set yuser #h:\users\wendy##
!set ypath #h:\save\newin\jpsoft##
!inc jpbtms
!end
!src jpbtms
!new #ypath#\4start.btm
!put #@echo off##
!inc startnt
!new #ypath#\tcstart.btm
!put #@echo off##
!inc starttc
!new #ypath#\alias.4nt
!inc aliases
!inc alias4nt
!new #ypath#\alias.tc
!inc aliases
!inc aliastc
!new #ypath#\environ.4nt
!inc environ4nt
!inc environs
!new #ypath#\environ.tc
!inc environtc
!inc environs
!end
!topic 4start
!src startnt
!put #alias /r #ypath#\alias.4nt##
!put #set /r #ypath#\environ.4nt##
!lbl starttc
!put #alias /r #ypath#\alias.tc##
!put #set /r #ypath#\environ.tc##
!end
!topic Aliases
!src aliases
dl:=m:\download
cdata:=h:\save\cdata
!put #user:=#yuser##
clipdesc=describe %1 /d"%@clip[]"
drives=echo %_drives
!lbl alias4nt
!lbl aliastc
!end
!topic Environment
!src environs
.rex=regina.exe
.cmm=secon32.exe
!lbl environ4nt
!lbl environtc
!end
!end