Will tSystem function with spaces?

One Star

Will tSystem function with spaces?

I'm trying to use tSystem in TOS 3.1.3 within a java project running on Linux in order to call a command line utility from VMWare:
tSystem Component Command:
"/usr/bin/vmrun -T server -h https://serverSmiley Tongueort/sdk -u username -p password -gu guestuser -gp guestpassword runProgramInGuest \" Virtual/virtual_file.vmx\" -activeWindow -interactive \"c:\\program files\\path\\program.exe\" /switch"
The issue seems to be with the spaces within the quoted paths, starting with the one after \"
Even though the double quotes are escaped, the tSystem command is broken at each space within the quoted string, just as though there were no quotes.
This same command runs perfectly in a Perl project using double quotes without the escape.
How might I deal with spaces properly? I thought that enclosing them in escaped double quotes would be sufficient.
On run, the jobs errors with:
Error: Cannot open VM: ", unknown file suffix
which seems to indicate that the command is being split on the space.
Six Stars

Re: Will tSystem function with spaces?

I think the quickest route is to create a custom shell script that launch the commands you want and then call the script from tsystem ( the advange is that you don't need to change the talend job if you need to change the script ).
tsystem in java uses api Runtime.exec that does split the argument string using spaces...
bye
One Star

Re: Will tSystem function with spaces?

Thanks. That's unfortunate.
Highlighted
One Star

Re: Will tSystem function with spaces?

Better fix implemented here in case anyone else comes across this issue again:
https://help.talend.com/search/all?query=Executing+a+command+with+spaces+using+a+tSystem+component&c...

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now