P
P
Pavel2018-07-13 00:04:24
linux
Pavel, 2018-07-13 00:04:24

How to forward multiple responses to the console for a script?

There is a console installer, when running it, it asks for 3 parameters. As far as I know, you can answer automatically for one parameter like this:
yes | java -jar setup.jar
And what about when there are 3 parameters?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2018-07-13
@rusbaron

cat <<EOF | java -jar setup.jar
yes
no
maybe
EOF

P
Pavel, 2018-07-13
@rusbaron

In addition to the option that was suggested above:
There is an expect
program Syntax similar to the shell, allows you to set timeouts, draws a conclusion depending on what is input.

A
Alexander, 2018-07-17
@Crysdd

#!/bin/bash
java -jar setup.jar yes no 125

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question