Reputation: 892
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
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