第四个shell实例

  |   0 评论   |   0 浏览
#!/bin/bash
set +x

cd /usr/local
tar -xvf pypackage.tar.gz
cd ./pypackage
ls *.tar.gz | xargs tar -xvf
for filename in `ls *.tar.gz`;
do
   tar -xvf ${filename}
done
rm *.tar.gz
for filename in `ls`;
do
   cd /usr/local/pypackage/${filename}
   temp=$(command -v python 2>&1 || { echo <&1 "py3";})
   echo $temp
   if [ "$temp" = "py3" ]; then
       python3 setup.py install
   else
       python setup.py install
   fi	   
done
cd /usr/local
rm pypackage -rf



标题:第四个shell实例
作者:SmiteLi
地址:https://smite.site/articles/2020/02/23/1582421919820.html