Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

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://server 0683p000009MAB6.pngort/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.
Labels (3)
3 Replies
Anonymous
Not applicable

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
_AnonymousUser
Specialist III
Specialist III
Author

Thanks. That's unfortunate.
Anonymous
Not applicable

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...