Installation Checks for Evan Aparri
Starters for Bash installation
python --version
python3 --version
function PythonInstallationCheck () {
printf "Checking python version\n"
if [[ $(python3 --version) ]]; then
py3version=$(python3 --version | cut -d" " -f2)
printf " - Python version $py3version has already been installed"
else
printf "Python not found"
fi
}
PythonInstallationCheck
function JavaInstallationCheck () {
printf "Checking java version\n"
if [[ $(java --version) ]]; then
javaversion=$(java --version | cut -d" " -f2)
printf " - Java version $javaversion has already been installed\n"
else
printf "Java not found\n"
fi
}
function JavaCInstallationCheck () {
printf "Checking javaC version\n"
if [[ $(javac --version) ]]; then
javacversion=$(javac --version | cut -d" " -f2)
printf " - JavaC version $javacversion has already been installed\n"
else
printf "JavaC not found\n"
fi
}
JavaInstallationCheck
JavaCInstallationCheck
function AnacondaInstallationCheck () {
printf "Checking anaconda version\n"
if [[ $(conda --version) ]]; then
anacondaversion=$(conda --version | cut -d" " -f2)
printf " - anaconda version $anacondaversion has already been installed"
else
printf "Anaconda not found"
fi
}
AnacondaInstallationCheck
function AnacondaPackageCheck () {
printf "Checking Anaconda package version\n"
if [[ $(conda list | grep $1) ]]; then
anacondapackageversion=$(conda list | grep $1 | awk '{print $2}')
printf " - Conda package $1 version $anacondapackageversion has already been installed"
else
printf " - Conda Package not found"
fi
}
AnacondaPackageCheck "nodejs"
function JupyterKernelsCheck () {
printf "Checking jupyter kernel installation"
if [[ $(jupyter kernelspec list | grep $1) ]]; then
kernelpath=$(jupyter kernelspec list | grep $1 | awk '{print $2}')
printf " - Jupyter $1 kernel has been found at $kernelpath"
else
printf " - Jupyter $1 kernel not found"
fi
}
kernels="bash javascript python3"
for i in $kernels; do
JupyterKernelsCheck $1
done