Quantcast
Channel: Script to check if some program is already installed - Ask Ubuntu
Viewing all articles
Browse latest Browse all 6

Script to check if some program is already installed

$
0
0

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 all articles
Browse latest Browse all 6

Trending Articles



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