Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

save & restore environment (Developers)

posted by Rugxulo Homepage, Usono, 01.03.2026, 00:24

> > 4DOS and NT's CMD both have "SETLOCAL". So if you don't need any vars to
> > persist, try that.
>
> Thanks for that information. 4DOS is really "where it's at" isn't it?

Yes and no. It's brilliant, but I always avoided it to write "portable" scripts. But it does make some things easier. (Honestly, it no worse than relying on a POSIX shell!)

> > If you insist on this way (presumably to run on older shells), I'd
> suggest
> > putting it in a single .BAT like "SAVEENV.BAT [on | off]". The AWK
> scripts
> > are small enough to be in-place, but even an embedded AWK script (or
> ten)
> > is easy to use.
>
> Here's an attempt at SAVEENV.BAT:

Here's an old example of mine that may give you ideas: invnas97.bat

 

Complete thread:

Back to the forum
Board view  Mix view
23246 Postings in 2191 Threads, 405 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum