Can I pass a "-host" IP in as a variable for runsc

Can I pass in an IP address (that changes as new test environments are deployed) to be used as the "-host" IP address in a runscript.bat script execution?

For example, instead of something like:

"C:\Eggplant\runscript.bat" "C:\test.suite\Scripts\test.script" -host 10.25.81.166 -port 5900

Can we do something like:

"C:\Eggplant\runscript.bat" "C:\test.suite\Scripts\test.script" -host VARIABLE -port 5900

Comments

  • EggplantMattEggplantMatt ForumAdmin admin
    You'd need to set up a batch file that took a parameter and used that value in the runscript call.
  • You'd need to set up a batch file that took a parameter and used that value in the runscript call.

    That is the general idea I had in mind Matt. I am just wondering how to actually implement it.

    If we capture the IP address in an orchestrated workflow that builds out the environment, and calling the batch file to run the eggPlant script is the next part of that workflow, how do I pass the value to a stand-alone batch file? Or, do I need to take the contents of the batch file and incorporate them directly in to the workflow instead?
  • Man, you sure do like to pass variables. :)

    YES, and it's not an eggplant question. This is a shell script question. The answer is this though...
    shellscript param1, param2
    

    in the shell script you call

    $1 and $2 as the variables, this will pull the params, you can have as many as you want.

    $1 corresponds to param1 and $2 corresponds with param2 and so on and so on...
  • I just saw your on windows and said "batch"..

    Everything I said above is the same, except instead of dollar signs you use percents.

    %1 corresponds with param1 and %2 corresponds with param2
  • I just saw your on windows and said "batch"..

    Everything I said above is the same, except instead of dollar signs you use percents.

    %1 corresponds with param1 and %2 corresponds with param2

    Thanks ne0hisda0ne. That is how we ended up resolving this. :D
Sign In or Register to comment.