I am working on a bash server setup script for ubuntu 14.03 LTS. For some of the commands the script is executing, it prompts the user to input 'yes/no' or 'Y/N'. For some of these commands I have been able to pass a flag to the command in question that will auto respond with a yes. For example: sudo apt-get install -y gcc
doesn't prompt the user.
On the other hand, I can't seem to find a way to do this for
sudo gem source -a http://rubygems.org/
.
It keeps prompting me with Do you want to add this insecure source? [yn]
.
So far I've tried the following:
yes | gem source -a http://rubygems.org/
which I found here
Any Suggestions?