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

上一篇:远距离无线音视频传输方案,物联网技术应用,无线远距离WiFi通信技术


下一篇:【CF1548E】Gregor and the Two Painters