Auto Passing a "q" before a Y on a command line
The q keypress serves as a quit signal for the pager less
, which is explicitly used by the script:
read FOO
echo "$licensetxt" | less
while true
do
MS_Printf "Please type y to accept, n otherwise: "
read yn
if test x"$yn" = xn; then
keep=n
eval $finish; exit 1
break;
elif test x"$yn" = xy; then
break;
fi
done
And man less
says:
Options are also taken from the environment variable "LESS".
Set this environment variable as follows:
printf '\ny\n' | LESS='+q' ./TeamSpeak3-Client-linux_amd64-3.0.19.4.run
Solution taken from @steeldriver's comment and added according to the law of @JamesTheAwesomeDude.