It's all about the answers!

Ask a question

"\" is stripped off from environment variables when pass from Windows to Unix


Jirong Hu (1.5k9295258) | asked Oct 19 '12, 12:25 p.m.
edited Oct 19 '12, 12:42 p.m.
The first couple of steps are executed in Windows server, the environment variable outputs as this:
	
	
	
FILE=M:\c999752_QRF_DEV\Informatica_QVOB\QRF_infa\xml\map\m_HUB_LT_RF_APPLICATION.xml
	
	
	
But in the next step when it's excuted in Unix, the environment variable becomes like this:
114 10/19/12 12:01PM ENV FILE=M:c999752_QRF_DEVInformatica_QVOBQRF_infaxmlmapm_HUB_LT_RF_APPLICATION.xml

How can I fix this?

This is the step running in Unix server:

echo "Start import/export to/from Informatica ${TARGET_ENV} environment"
/usr/bin/perl bldInfa.pl ${APP_NAME} ${TARGET_ENV} ${COMMAND} ${FILE}

I create these environment variables in BF, and set it from ClearCase (server on Windows) trigger script as below:

   my $buildEnvEntryName = "FILE";
   my $buildEnvEntryToUpdate = BuildForge::Services::DBO::BuildEnvironment->findByUuid($conn, $buildEnvUuid)->getEntry($buildEnvEntryName);
   if(!defined($buildEnvEntryToUpdate)) {
       print "BuildEnvironmentEntry <".$buildEnvEntryName."> could not be found.\n";
       return 1;
   }
   $build->updateBuildEnvEntryValue($buildEnvEntryToUpdate->getUuid(), $file);


Thanks
Jirong

2 answers



permanent link
Spencer Murata (2.3k115971) | answered Oct 19 '12, 1:51 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
 There are two ways I have seen to fix this, either double the slashes "\\" or instead of using a slash use a variable e.g. ${FILE_SEP} and set it on the Unix server to a "/" and on the Windows server a "\".

permanent link
Jirong Hu (1.5k9295258) | answered Oct 25 '12, 5:17 p.m.
 I resolved this issue by replacing "\" to "/" when pass on environment variables from Windows to Unix. Now I am hitting the same issue when I try to do a ".runwait "Informatica-PRD". In the launched project "Informatica-PRD", again the "/" is lost, even I make it "//", it still lost and becomes like this: 
FILE=M:c999752_ABC_DEVInformatica_AVOBABC_infadummyQEM.txt
	



Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.