NoLiver92
NoLiver92

Reputation: 892

Is subversion installed

I am creating a bash script in linux, is there a way to detect if subversion is installed on the computer?

I am wanting to detect if its installed and if it isnt prompt the user to install it, I can prompt the user but I cant detect if the program is installed

Upvotes: 1

Views: 59

Answers (1)

Matteo
Matteo

Reputation: 14930

PROG=$(which svn 2> /dev/null)

if [ -z "$PROG" ] ; then
    echo "cannot find subversion" 1>&1
else
    echo "Subversion installed at $PROG"
fi

Upvotes: 4

Related Questions