The program.run I'm trying to run:
- Asks 2 questions that need the answer "y"
- Asks a third question at the end which is "press any key to exit"
In addition, it doesn't have the "-y" option. Only this options:
FreeFileSync installation parameters:
-h, --help Show help
--directory Change installation directory e.g. --directory /opt/FFS
--noshortcuts Don't create desktop shortcuts
And neither of these commands work:
yes | sudo ./program.run
yes y | sudo ./program.run
sudo sh -c 'yes y | ./program.run'
echo y | sudo ./program.run
# etc, etc
Since the "yes" command does not seem to work, I would like to try anything else
In this answer, say: "a .run command is simply a set of commands that are going to be run by sh. A particular .run file might take a -y option but in general you can't count on it. If you need to automate some stuff, consider using Expect".
But I don't know how to use Expect. Some help?
Distro: Ubuntu Mate 20.04 LTS
Bash 5.0.17(1)-release (x86_64-pc-linux-gnu)
Update:
I have posted this issue on the official site and the developers announced that in the next version they will add the parameter:
./program.run --accept-license
In
expect
that would be:Run:
If I want to provide auto answers for 3 questions as follows:
y< enter >
y< enter >
< enter >
I would use something like: