Context Variable

One Star

Context Variable

hi,
I created one talend job, wic have 4 context variable. now i exported the job. after exporting job i got shell script (.sh file).
i want to pass value of context variable as manually. i know how to pass value i.e. --context_param backup_path=/root/abc .
now i still have context variable 'source,dest,failure'... how to assign value to these remain three???
Regards,
Akshath Hegde
Moderator

Re: Context Variable

Hi,
Open the your executable file, xxx.sh on Unix / Linux. Assign value to these three context variables 'source,dest,failure' as
--context_param source=xxx --context_param dest=xxx --context_param failure=xxx in your .sh file.
Let me know if it is OK with you.
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.
One Star

Re: Context Variable

hi,
Thank you for quick reply Sabrina. Now in script i gave like this,
--context_param source=xxx dest=xxx failure=xxx
And its working. Now which one i should use? which is prepared by talend???
Regards,
Akshath Hegde
Moderator

Re: Context Variable

Hi,
Now which one i should use? which is prepared by talend???

What's your expected result? Don't you pass value of context variable as manually? Could you give us more description about your current job and requirement.
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.
One Star

Re: Context Variable

hi,
I have perl program which call this shell script. so in perl code im passing command line argument so shell script as follows,
`sh xxx.sh \root\source \root\dest \root\fail`
and in shell script i wrote as follows,

--context_param source=${1} dest=${2} failure=${3}
now everything is working fine.
but you told in previous comment different syntax and im using different syntax. my question is "which is better way to use --context_param?? with first variable or with every context variable ??"
Regards,
Akshath Hegde
Moderator

Re: Context Variable

Hi,
They are both working for you?
--context_param source=xxx dest=xxx failure=xxx
or --context_param source=xxx --context_param dest=xxx --context_param failure=xxx

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

Re: Context Variable

hi,
yes sabrina. i tested using both method its working fine.
Regards,
Akshath Hegde
Moderator

Re: Context Variable

Hi,
Usually, we use context_param source=xxx --context_param dest=xxx --context_param failure=xxx parameter in .bat/.sh file.
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.