Search code examples
mysqllinuxbashpercona

How to set input from bash script in an interactive shell?


So when I install percona mysql, I get the following.

enter image description here

I am trying to automate sql installation using a bash script but how do I enter into the input using bash script? Enter something > hit enter.


Solution

  • The preferred way of achieving this is using unattended mode by setting the following environment variable before calling apt install:

    export DEBIAN_FRONTEND=noninteractive
    

    This will not prompt the user for any input but instead use the default values for everything.

    If you want to supply an answer to a configuration question different to the default value, use preseeding DebConf.