Quantcast
Viewing latest article 6
Browse Latest Browse All 6

Script to check if some program is already installed

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

Viewing latest article 6
Browse Latest Browse All 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>