learning shell check host dependent pkg (8)

Purpose

       Shell script check host dependent pkg

 

Eevironment

       Ubuntu 16.04 bash env

 

Procdeure

  Source code: 

    dependent_pkg="gitk"
    for pkg in $dependent_pkg; do
    if ! dpkg-query -l $pkg | grep -q ii; then
        echo installing $pkg ..
        sudo apt-get -y install $pkg
    fi
    done
posted @ 2019-12-09 20:11  嵌入式实操  阅读(136)  评论(0编辑  收藏  举报