How can I create a bash script that checks if a program is already installed, and if it isn't, installs it?
Thanks for your help.
Here's the code I have so far:
#/bin/bash
PS3="choose an option"
select opcion in "Installing_Youtube" "exit"
do
case $opcion in
"Installing_Youtube")
youtube-dl > /usr/bin
if [ $? -eq 127 ] ; then
echo "installing youtube"
apt-get update
apt-get install youtube-dl
mkdir Videos
else
echo "Youtube already installed"
fi
;;
"exit")
exit
/usr/bin
?apt-mark showmanual
then installing with something likeapt-get install "$(< package.list)"
.