Summary
This article discusses how to remove the newline or carriage return character from $EXECUTE_STDOUT$ for Execute Script/Batch File and Execute Command actions.
Synopsis
When running an Execute Script/Batch File action or an Execute Command action, the STDOUT value will be returned with a newline character appended to the end of the string. This newline character may be unwanted when stored in an InstallAnywhere variable. The steps outlined below provide a way to remove the newline character from the variable's value.
Discussion
To remove a newline character as well as any white spaces from the beginning and end of a string, a Custom Code action can be used. The steps below uses the ModifyString Custom Code action available from Revenera's website: InstallAnywhere Custom Code Extensions.
To remove a newline character from Execute Script/Batch File and Execute Command actions:
- Download the ModifyString extension and unzip it.
- Add a Set InstallAnywhere Variable action and set
$MS_STRING_TO_CONVERT$to the variable that contains the string with a newline character (i.e.$MS_STRING_TO_CONVERT$ = $EXECUTE_STDOUT$). - Follow the General Instructions in the
ModifyString.htmfile (included in theModifyString.zipfile) to implement the custom action. - Use the
$MS_STRING_TRIM$output variable that gets set by the ModifyString action to obtain the new string value with the newline character removed.
Additional Information
When executing a command that prevents a newline character from being created, such as the following on Linux:
echo -n $variable
a newline character is still added to the string stored in the $EXECUTE_STDOUT$ InstallAnywhere variable set by the action.
An enhancement request has been submitted to our Engineering team as Issue # IOA-000066612 to address this. Our Engineering team is investigating this issue, but at this moment, there is no estimated time frame for when a fix will be implemented.
Related Articles
Limitation of the Execute Target File Action 8Number of Views Aspnetcore-runtime not getting installed through Execute/batch file action 6Number of Views Compliance Library Installer: Error while attempting to execute the installation script 9Number of Views Execute Uninstaller Action Does Not Uninstall 8Number of Views Execute a VBScript File From InstallScript 11Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add additional feedback (optional)
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
|
FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513
(toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367
(toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895
2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago