representing an equals symbol as an argument

Comments

1 comment

  • Avatar
    Sachin Sudheendra

    Hi Jason,

    We tried with the below setup

    Batch file: (run.bat)
    @echo off
    echo "========"
    echo %1
    echo %1%
    echo %%1%%
    echo ^%1
    echo "========"

    Job output:
    [go] Start to execute task: <exec command="run.bat" >
    <arg>"testProp1=testValue1"</arg>
    </exec>.
    "========"
    "testProp1=testValue1"
    "testProp1=testValue1"
    %1%
    "testProp1=testValue1"
    "========"

    [go] Start to execute task: <exec command="run.bat" >
    <arg>"testProp1==testValue1"</arg>
    </exec>.
    "========"
    "testProp1==testValue1"
    "testProp1==testValue1"
    %1%
    "testProp1==testValue1"
    "========"

    [go] Start to execute task: <exec command="run.bat" >
    <arg>testProp3=testValue3</arg>
    </exec>.
    "========"
    testProp3
    testProp3
    %1%
    testProp3
    "========"

    The first two cases were sent in as the %1 argument to the batch file and could be consumed as strings. The third case is different where you're trying to pass a key=value pair onto the batch file. For this usecase we suggest using Go Environment Variables (http://www.thoughtworks-studios.com/docs/go/12.3/help/admin_set_environment_variables.html) and consuming the variable value in the batch file.

    Also, you mentioned that the second case in your setup threw up an error. Can you attach the failure console log so that we analyze the cause?

    Hope this helps.

    0
    Comment actions Permalink

Please sign in to leave a comment.