How to call .sh file from Talend

Five Stars

How to call .sh file from Talend

Hello All,

 

I have a requirement to call shell script(.sh file) in my talend job?

I'm using windows operating system and .sh file was placed on my windows desktop, I have to call .sh file in talend and pass the output to target

can any one tell me how can we achieve this requirement?

 

Regards,

Bharath

 

 

Moderator

Re: How to call .sh file from Talend

Hello,

Here is a tSystem component in talend which calls other system processing commands, already up and running in a larger Job.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: How to call .sh file from Talend

Hello Sabrina,

 

Thanks for your response!!

 

Could you please provide me some in-sights how shall i call .sh script in tsystem component?

 

For Ex:  Test.sh

------------------------------------

#!/bin/bash -e
indate=$1
opDate=$(date "--date=$indate -1 day")
return opDate

---------------------------------

Above is the .sh file(Test.sh) which was placed on my windows box and talend is in same machine.

I'm not sure how can i get output from Talend?

 

Regards,

Bharath

Six Stars

Re: How to call .sh file from Talend

If you want to run your sh command from your windows box to linux system then you can use tSSH component.

 

You can create that sh file in a context variable and put it into the 'command' text area.

if you are planning to run this job on the linux server then you can tSystem component