Hey guys,
I'm new to scripting and I'm trying to work on a script that will call out functions based on the version of ubuntu being run
What I have so far:
Code:
#!/bin/sh
version='lsb_release -sr'
#check for version of ubuntu
$version
if [ $version == '16.04' ]
then
echo "Version of ubuntu is 16.04 running script"
elif [ $version == '14.04' ]
then
echo "Version of ubuntu is 14.04 running script"
elif [ $version == '12.04' ]
then
echo "Version of ubuntu is 12.04 running script"
fi
However the bash script just tells me it's too many arguments. I'm most likely going about this the wrong way but happy for someone that knows better that can provide some tips.
Bookmarks