I'm running the following interactive Jar.
java -jar script.jar
argument-line-here
\n
Now I'm creating a bash script which runs the jar file. How do I pass the argument line and the conformation "\n" to this interactive script? these are input lines for the script.
This question has some answers, expect
is not yet installed on my system and i do not have sudo.
edit: The .jar also doesn't return any text. it only expects 2 lines. (one with arguments and one with a conformation enter). I also cannot edit the Java application. It is not my script. If I could've I would've.
Things I have tried but didn't work.
java -jar myscript.jar
<<< &"argument1 argument2 argument3 argument4" <<< $"\n"
and
java -jar java -jar myscript.jar > tmp.txt
expect ""
send "argument1 argument2 argument3 argument4"
expect ""
send "\n"