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

learning shell check host dependent pkg的更多相关文章

  1. learning shell check requires root privileges

    [Purpose]        Shell script check requires root privileges   [Eevironment]        Ubuntu 16.04 bas ...

  2. learning shell built-in variables (1)

    Shell built-in variables [Purpose]        Learning shell built-in variables, example $0,$1,$2,$3,$#, ...

  3. Check Host:实时监控网站或者服务器是否可以访问

    如果你拥有一个网站,那么最重要的事情就是要保证它24小时都能够访问.不过国内的虚拟主机服务非常糟糕,经常会出现各种状况,所以我们需要一个软件,可以让我们第一时间知道网站出现了无法访问的情况,从而通知售 ...

  4. SSH Secure Shell Client--- the host may be dow

    the host may be down,or there may be a problem with the network connection. Sometimes such problems ...

  5. learning shell script prompt to run with superuser privileges (4)

    Shell script prompt to run with superuser privileges [Purpose]        Check whether have root privil ...

  6. learning shell args handing key=value example (2)

    Shell args handing key=value example [Purpose]        Learning how to handing ker=value args   [Eevi ...

  7. shell (check return of each line)and sudoer

    shell result from cmdline echo $? if 0 then success ;else failure (shell 执行每部返回值,rm -rf 错误,打包不能覆盖) 解 ...

  8. learning shell display alert function

    [Purpose]        Shell print function base on err info wrn ext output level   [Eevironment]        U ...

  9. learning shell get script absolute path (3)

    Shell get script absolute path [Purpose]        Get shell script absolute path   [Eevironment]       ...

随机推荐

  1. python解决使用镜像源来安装包

    一.问题在进行python包安装的时候出现一个问题就是无法进行安装,且出现了如下的错误 报错代码 Retrying (Retry(total=4, connect=None, read=None, r ...

  2. C# - List.Sort()自定义排序方法

    本文通过示例介绍了C#中典型容器List.Sort()的自定义排序方法,进而引出了C#中自定义排序的核心接口及方法 项目地址:自定义Sort方法 - SouthBegonia's Github Lis ...

  3. 如何判断两个IP地址是不是处于同一网段?

    个人理解,欢迎指正. 一.要判断两个IP地址是不是在同一个网段,就将它们的IP地址分别与子网掩码做与运算,得到的结果-->网络号,如果网络号相同, 就在同一子网,否则,不在同一子网. 例:假定选 ...

  4. javascript中五种迭代方法实例

    温习一下js中的迭代方法. <script type="text/javascript"> var arr = [1, 2, 3, 4, 5, 4, 3, 2, 1]; ...

  5. Windows 查看端口占用进程并关闭

    当我们在运行一些软件需要特定软件(如tomcat)时,有可能会碰上端口被占用的情况,这时候我们可能就需要更改端口或把占用端口的进程结束掉,因为更换端口可能会导致当前环境产生一些的问题或是需要重新配置其 ...

  6. Zookeeper学习笔记:简单注册中心

    zookeeper可以作为微服务注册中心,spring cloud也提供了zookeeper注册中心的支持. 本文介绍如何实现一个简单的zookeeper注册中心,主要的实现方式: n个服务提供者对外 ...

  7. Java自学-数字与字符串 格式化输出

    Java 使用printf或format 进行格式化输出 步骤 1 : 格式化输出 如果不使用格式化输出,就需要进行字符串连接,如果变量比较多,拼接就会显得繁琐 使用格式化输出,就可以简洁明了 %s ...

  8. 【转】用Python做股市量化策略投资数据分析

    金融量化分析介绍     本文摘要; 金融量化分析介绍 1.什么是金融量化分析 2.金融量化分析可以干什么 3.为什么将python运用于金融 4.常用库简介 1.什么是金融量化分析 从标题中我们可以 ...

  9. python day 22 CSS拾遗之箭头,目录,图标

    目录 day 4 learn html 1. CSS拾遗之图标 2. html文件的目录结构 3. CSS拾遗之a包含标签 4. CSS拾遗之箭头画法 day 4 learn html 2019/11 ...

  10. 英语muttonfatjade羊脂玉muttonfatjade单词

    羊脂玉英文(mutton fat jade) 中文名羊脂玉 外文名muttonfatjade 羊脂玉又称白玉,为软玉中之上品,极为珍贵.主要含有透闪石(95%).阳起石和绿帘石.非常洁白,质地细腻,光 ...