The format for passing character strings to an external program.

Tags:

#1 andy_kr

Please help me with the character string transfer format. I need to pass a character string to an external program. I do it like this:

<Extension exec> Module xm_exec </Extension>

<Output to_db_repldata_access_log> Module om_null EXEC exec('c:\Windows\System32\cmd.exe','/U','/C','C:\Tools\NXLog\log_access_insert.bat', $Access_Resource); </Output>

When the $Access_Resource field contains a character string without spaces, such as 'qwerty', then the string is passed without quotes, just qwerty

When the $Access_Resource field contains a character string with spaces, such as 'qwer ty', then the string is passed in double quotes - "qwerty"

Questions:

  1. How to unify the way the string is passed, either always in double quotes or always without quotes?
  2. Is it possible to configure the transmission of the string always in single quotes?
#2 carlos.caro Nxlog ✓
#1 andy_kr
Please help me with the character string transfer format. I need to pass a character string to an external program. I do it like this: <Extension exec> Module xm_exec </Extension> <Output to_db_repldata_access_log> Module om_null EXEC exec('c:\Windows\System32\cmd.exe','/U','/C','C:\Tools\NXLog\log_access_insert.bat', $Access_Resource); </Output> When the $Access_Resource field contains a character string without spaces, such as 'qwerty', then the string is passed without quotes, just qwerty When the $Access_Resource field contains a character string with spaces, such as 'qwer ty', then the string is passed in double quotes - "qwerty" Questions: How to unify the way the string is passed, either always in double quotes or always without quotes? Is it possible to configure the transmission of the string always in single quotes?

Hi Andrey,

You can unify the format of the character string by removing the double quotes from the .bat script.

Regards,
Carlos.