FIX CONFIG.SYS with REXX, and automates installing essentials. DGD 02-05-2007
Released into public domain for use on OS/2 - ECS systems only.

A customizable script for basic changes to CONFIG.SYS upon new installation,
but probably won't mangle it at any time. Can be tested on a non-boot drive.
Oriented toward plain Warp 4, but again, probably won't mangle other versions.

CAUTION: make a copy - or several - of CONFIG.SYS before doing anything!
After considering various program schemes, I advise that you manually copy 
CONFIG.SYS to a floppy, SET its READ-ONLY attribute, then take that floppy 
out of the drive, and slide the write-protect tab. 

For yet more SAFETY, you will have to edit FCS.CMD before it will run on any
drive except Z:. Simply move the '/*' to before the 'if' test.

If you think the above is excess caution, you've never lost CONFIG.SYS and
all recent versions. That can be annoying.

YHBW! (You Have Been Warned! - Surely common enough to make an acronym.)

Anyhoo... Four procedures are the core. The first two procedures listed below
make a global check that new text is nowhere duplicated; this is nearly always
true, and if not, each will ask if you wish to insert the new text anyway. 

Calls can be made in any order because they find the first line that starts
with specified text and then:

add_after   : inserts a line after it; option puts new text on last line;
              if the specified line is not found, asks whether to put new text
              at end so that you'll have it, to be manually moved if necessary
              (some items in CONFIG.SYS are position dependent; there's no
              "add_before" procedure because the order in a new installation
              is fixed and some other line can be used for reference)
modify_line : finds specified text within the line, replaces it with new; 
              optional syntax replaces the entire line, or clears it
remark_line : inserts "rem " at start
add_to_line : adds text to end of line (useful for paths)

The xcopy section lets you pick source and target drives; usage should be
obvious. 

Slightly less obvious is making program objects, though basic ones are easy.
If you need options, see the included KEYWORDS.TXT for more on setup strings.

Examples included can be commented out, but have checks to make harmless. 

Okay, I'm done. You have the source to do all the customizing that you wish.
Turned out that text replacement with duplication checks was slightly more 
than trivial, so thought maybe someone would find this useful to build on.
