IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Shell script adapter with parameters

    Posted 02/14/07 11:49 AM

    Originally posted by: SystemAdmin


    Hi,

    I would like to call the SHL (shell script) adapter to call a shell script and pass several parameters to it.

    The only way to make this work was to create dynamically a temporary file that contains the name of the sript and the parameters and to call this temporary file as a shell script by the adapter.

    I used the GET command for that.

    This is not a very clean solution.

    Does anybody know which is the best way to call a shell script and to pass parameters without generating temporary files dynamically ?

    Thanks all.


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Shell script adapter with parameters

    Posted 02/14/07 02:22 PM

    Originally posted by: john.gibby


    I had a time understanding the shell/batch script adapters. I just couldn't understand the documentation clearly and had to play around with the command switches to get it to work. Here's how I execute all my shell scripts:

    codeGET(
    "SHL"
    ,"-cli -cmd '" + ScriptName + " " + Arg1 + " " + Arg2 + " '"
    )[/code]

    Or if you just want to hard code the command string:

    codeGET(
    "SHL"
    ,"-cli -cmd 'somescript.sh -XYZ targetfile '"
    )[/code]

    Good Luck!

    John M Gibby
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: Shell script adapter with parameters

    Posted 02/15/07 03:14 AM

    Originally posted by: SystemAdmin


    Thank you John,
    this is exactly what I was looking for.
    I don't really understand why there is a space at the end and why the single quote closes first, though. But anyway, it works !

    Thanks.
    Marco
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Shell script adapter with parameters

    Posted 02/15/07 07:43 AM

    Originally posted by: john.gibby


    You need to enclose your command and it's arguments with single quotes.

    GET("SHL","-cli -cmd 'shellscript arg1 arg2'")

    John
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange