top工具的安装-(shell4)
作者:互联网
#/bin/bash
HOME="/home"
HTOP_URL="http://hisham.hm/htop/releases/2.2.0/htop-2.2.0.tar.gz"
if [ ! -d "$HOME" ]; then
mkdir $HOME
fi
rpm -q ncurses-devel &>/dev/null
if [ $? -ne 0 ]; then
yum -y install make ncurses-devel
fi
rpm -q wget &>/dev/null
if [ $? -ne 0 ]; then
yum -y install make wget
fi
rpm -q tar &>/dev/null
if [ $? -ne 0 ]; then
yum -y install make tar
fi
cd $HOME
wget -c $HTOP_URL
tar zxvf htop-2.2.0.tar.gz
cd htop-2.2.0
./configure && make && make install
if [ $? -ne 0 ]; then
echo "make或make install失败"
exit
else
echo "make成功"
fi
标签:shell4,tar,top,htop,install,2.2,fi,安装,make 来源: https://blog.csdn.net/u010872015/article/details/118933338