0

So I am using a OSS written in go which I don't have any exposure to. I am trying to automate that script.

SO this is how the script works calling_go_code Message for confirmation of user Get user input execute the code.

I am trying to automate this script.

So far this is what I have tried, sh test.sh Param1

When I am running the script like

echo "hello"
calling_go_code

The above code asks for some parameter as input test.sh

sh test.sh Param1

echo "hello"
calling_go_code -- $1
onkar
  • 4,427
  • 10
  • 52
  • 89

1 Answers1

0

Based on @RichardHuxton's post. This is the solution I am using

#!/usr/bin/expect -f


set alias [lindex $argv 1]

set input [lindex $argv 0]

set timeout -1

COMMAND I AM USING 

expect {

    "*CONFIRMATION MESSAGE 1" { send -- $alias\r }


    exp_continue

}


expect {

    "*CONFIRMATION MESSAGE 2" { send -- $alias\r }


    exp_continue

}

expect eof

Calling bot

 ./bot param1 param2

Dependency of Expect

onkar
  • 4,427
  • 10
  • 52
  • 89