Reputation: 35099
Have a quick question,
imagine that I have this code:
mkdir -p $INSTALLDIR
sudo apt-get install -y git clojure leiningen
git clone git://github.com/maltoe/storm-install.git
./storm-install/storm_install.sh all `hostname` $INSTALLDIR
And this script will ask, do you want to install additional packages, and I want to say yes
,
How to do this automatically?
Or may be there is a way to kinda answer yes to any question by default?
Upvotes: 20
Views: 37665
Reputation: 151
I not sure but i advice try:
echo yes | ./storm-install/storm_install.sh all `hostname` $INSTALLDIR
Upvotes: 15
Reputation: 15194
apt
has also --force-yes
option which may be helpful:
--force-yes
Force yes; This is a dangerous option that will cause apt to
continue without prompting if it is doing something potentially
harmful. It should not be used except in very special situations.
Using force-yes can potentially destroy your system! Configuration
Item: APT::Get::force-yes.
Upvotes: 3
Reputation: 16379
assume storm asks the question - use a here document - example:
mkdir -p $INSTALLDIR
sudo apt-get install -y git clojure leiningen
git clone git://github.com/maltoe/storm-install.git
./storm-install/storm_install.sh all `hostname` $INSTALLDIR <<-EOF
yes
EOF
The EOF can be any nonsense characters the shell will not interpret.
Upvotes: 6