Why does oadutil reg -e' with blank characters fail?
Question:
When using the -e option to pass a PATH environment variable to the OAD I experience the following problems on Windows NT
1. using the following
-e PATH="C:Program FilesDevStudioSharedIDEBIN;C:Program FilesDevStudioVCBIN;C:Program
FilesDevStudioVCBINWINNT;d:jdk1.1.6bin;D:vbc33bin;D:vbc33adm;C:WINNTsystem32;C:WINNT;C:Program FilesMaestro.nt;C:ORANTBIN;;E:DevStudioVCBIN;E:DevStudioVCBINWINNT"
is read as
env = (length=1)[PATH=c:Temp;C:Program; ]
It does not recognize the space in program files
2. using -e PATH="C:Program FilesDevStudioSharedIDEBIN;C:Program FilesDevStudioVCBIN;C:Program FilesDevStudioVCBINWINNT;d:jdk1.1.6bin;D:vbc33bin;D:vbc33adm;C:WINNTsystem32;C:WINNT;C:Program FilesMaestro.nt;C:ORANTBIN;;E:DevStudioVCBIN;E:DevStudioVCBINWINNT"
I get the following exception
Assertion failed!
Program: d:vbc33examplesaccountaccount_server.exe File: vpipe.C Line: 55
Expression:_fd{i}>=0
This also occurs in VBC32 NT
This is possibly a duplicate of failure 8769
Answer:
The problem can be easily solved by using shell escape character :
original command: oadutil reg -i Account -o Jack B. Quick -cpp account_server -e test="1 2"
using shell escape character, the problem is gone: oadutil reg -i Account -o Jack B. Quick -cpp account_server -e test="1 2"
The problem is due to the double quote character, ", being interpreted by the shell before it gets passed over to our actual command.
Article originally contributed by Thomas Moyles