用shell脚本安装软件,注意格式细节与ubuntu早期版本有区别
echo '\033[0;35;1m*** 解压Eclipse for cpp, start ****\033[0m'
EclForPy3Org=~/Software/eclipseEclForPy3Path=~/Software/EclipseForPy3
EclForPy2Path=~/Software/EclipseForPy2
if [ -d $EclForPy3Org ]; then #若已经解压过了,就不再解压
echo 'Eclipse解压完成'
if [ ! -d $EclForPy3Path ]; then
mv $EclForPy3Org $EclForPy3Path
echo 'Eclipse for Python3'
elif [ ! -d $EclForPy2Path ]; then
mv $EclForPy3Org $EclForPy2Path
echo 'Eclipse for Python2'
else
echo 'Eclipse for Python2 and Python3 already existed'
fi
else #若没有解压,则解压
tar -zxvf ~/Temp/eclipse-cpp-neon-R-linux-gtk-x86_64.tar.gz -C ~/Software
echo 'Eclipse解压完成'
if [ ! -d $EclForPy3Path ]; then
mv $EclForPy3Org $EclForPy3Path
echo 'Eclipse for Python3'
elif [ ! -d $EclForPy2Path ]; then
mv $EclForPy3Org $EclForPy2Path
echo 'Eclipse for Python2'
else
echo 'Eclipse for Python2 and Python3 already existed'
fi
fi
if [ -d $EclForPy3Org ]; then #若已经解压过了,就不再解压
echo 'Eclipse解压完成'
if [ ! -d $EclForPy3Path ]; then
mv $EclForPy3Org $EclForPy3Path
echo 'Eclipse for Python3'
elif [ ! -d $EclForPy2Path ]; then
mv $EclForPy3Org $EclForPy2Path
echo 'Eclipse for Python2'
else
echo 'Eclipse for Python2 and Python3 already existed'
fi
else #若没有解压,则解压
tar -zxvf ~/Temp/eclipse-cpp-neon-R-linux-gtk-x86_64.tar.gz -C ~/Software
echo 'Eclipse解压完成'
if [ ! -d $EclForPy3Path ]; then
mv $EclForPy3Org $EclForPy3Path
echo 'Eclipse for Python3'
elif [ ! -d $EclForPy2Path ]; then
mv $EclForPy3Org $EclForPy2Path
echo 'Eclipse for Python2'
else
echo 'Eclipse for Python2 and Python3 already existed'
fi
fi
echo '\033[0;35;1m*** 解压Eclipse for cpp, end ****\033[0m'