IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
#Supplychain
 View Only

Cross platform method of executing OS commands

  • 1.  Cross platform method of executing OS commands

    Posted 06/29/16 07:12 AM

    Originally posted by: paul.brett


    I was recently asked to provide a cross platform method of removing 2 files immediately using a map.  This was the solution I used, others are possible:

    =IF(MID(GETDIRECTORY(),2,1)=":",GET("BAT","CMD /c if exist File1.zip del File1.zip > nul & if exist File2.zip del File2.zip > nul & echo done!"),GET("SHL","rm File1.zip File2.zip ; echo done!"))

    Using the GETDIRECTORY() function with no argument gives me the map path, and then checking the second character for a colon (:) tells me whether this is Windows (or not).

    Thank-you

    Paul

    Follow me on Twitter


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