Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to run a Talend job to call a unix shell script using tsystem , but I noticed that the parameters I am passing while calling the shell script is not getting passed to script.
I tried multiple ways but could not find a way to achieve this
Following is the command I used :
"sudo su - talend_user -c myscript.sh "+context.param1+" "+context.param2+" "+context.param3
Hi
Is myscript.sh a job script? Please try:
"sudo su - talend_user -c myscript.sh --context=Default --context_param varName1="+context.varName1
Regards
Shong
Hi @Shicong Hong
Like this? Please note the space after Name1+"
Regards,
Raghu
@Shong .. This is a unix shell script whicj is trying to perform some operations on files.
@Shicong Hong I tried following approach, it does not seems to be working :-
"sudo su - talend_user -c myscript.sh --context=Default --context_param param1="+context.param1+" --context_param param2="+context.param2+" --context_param param3="+context.param3+" --context_param param4="+context.param4
I also tried an alternative approach :-
"sudo su - talend_user -c myscript.sh param1="+context.param1+" param2="+context.param2+" param3="+context.param3+" param4="+context.param4
I don't see parameters getting passed to my unix shell script
Hi
The -context_param is used to pass value to context variables when executing the Talend job script out of studio, if myscript.sh is a common unix shell script, please google it on internet, eg:
https://unix.stackexchange.com/questions/31414/how-can-i-pass-a-command-line-argument-into-a-shell-script
https://unix.stackexchange.com/questions/372713/how-can-i-pass-variable-in-script-via-terminal-when-execute-abc-sh
Regards
Shong
I tried to search lots of options to run a script from talend and looks to me that although talend facilitates running script but does not support passing parameters to the unix shell script.