Update:
Since I want things to also work with older Base releases, I added a workaround on Windows, allowing the Windows notation of %varname% to read the value from the environment post iocShell inside my driver code. Straightforward and good enough.
But:
I still think the current macLib policy of keeping escapes at the top level and resolving them at any other use is not right.
Here's an example.
Assume I have a driver with an iocShell configuration function that takes a path as its parameter and I want to use backslashes as a path separator.
When using the configuration function directly, I need to escape the backslashes to get them into the driver. So far, so expected.
epics> driverSetup C:\\foo\\bar
If I want to plainly do the same thing through an environment variable, guess how many backslashes it takes? Eight!
epics> epicsEnvSet MYDIR C:\\\\\\\\foo\\\\\\\\bar
epics> driverSetup $(MYDIR)
IMHO, this is insane.
Cheers,
~Ralph