Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm using tsystem to run 2 similar commands in Linux separated by ";".
They work perfectly fine in shell with the ";" like touch file1.txt ; touch file2.txt , but in Talend job I could only get the first command to work alone.
My current single command in tSystem looks like this is as follows:
"aws ssm get-parameter --name /mypath/"+context.db_user+" --with-decryption --region "+context.db_region+" --output text --query Parameter.Value ; aws ssm get-parameter --name /mypath/"+context.sf_bi_user+" --with-decryption --region "+context.db_region+" --output text --query Parameter.Value"
When I run the first aws command , alone, it works perfectly fine with variables and such, the problem seems to be with the semicolon and after that since it ouputs this:
Note: AWS CLI version 2, the latest major version of the AWS CLI, is now stable and recommended for general use. For more information, see the AWS CLI version 2 installation instructions at: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
Unknown options: aws, ssm, get-parameter, ;
What can possible be wrong? I've tested with double quotes at the beginining/end, after each command, but ...no luck. Really not getting what's the difference between these 2 commands and 2 simpler ones like touch, working ...
try with "&" this instead of ";"
Thanks, but it doesn't work either. It seems to be an issue with quotes or variable replacement when there are two commands, because trying with just "touch file1.txt ; touch file2.txt" it works fine.
Also, ";" and "&" have different meanings here.
could you try to select the "use array command" in tSystem and then write your two commands one by one by adding "+" and then test it
Doesn't work either . --> Exception in component tSystem_1 (parent_job)
java.io.IOException: Cannot run program "aws ssm get-parameter --name (...)": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
I've tried both commands in just 2 lines , enquoted with ", with ";" in a line, the 2nd command in the 3rd line, I've tried ; after the first command or at the beginning at the 2nd command ...still, doesn't work 😞
can you show me the screen shot ? what you tried in the array command
Hi , I am facing same issue . Unable to trigger multiple commands in Parallel from tSystem . Only the first command is executing leaving the other commands without executing.
Tried both "sh shell.sh & sh sehll2.sh"
"sh shell.sh ; sh sehll2.sh"
None of the above are working in Unix environment.
If someone resolved this issue, request me to help.
In case of a bug from talend, do let us know the patch to fix it.
tSystem component on Unix/Linux flavors seem to be having issues. I faced similar issues when I tried using wild card characters in a very simple delete file command. Interestingly the same command if executed from Linux prompt works well with no issues. I opened a support ticket and no big success from them as well.
My recommendation would be to either have multiple tSystem components, one for each .sh (I used this trick and it works for me) or include all the functionality within one .sh and call that .sh from tSystem component.