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. golang socket与Linux socket比较分析

    在posix标准推出后,socket在各大主流OS平台上都得到了很好的支持.而Golang是自带runtime的跨平台编程语言,Go中提供给开发者的socket API是建立在操作系统原生socket ...

  2. In-Memory:哈希索引

    SQL Server 2016支持哈希查找,用户可以在内存优化表(Memory-Optimized Table)上创建哈希索引(Hash Index),使用Hash 查找算法,实现数据的极速查找.在使 ...

  3. kafka broker Leader -1引起spark Streaming不能消费的故障解决方法

    一.问题描述:Kafka生产集群中有一台机器cdh-003由于物理故障原因挂掉了,并且系统起不来了,使得线上的spark Streaming实时任务不能正常消费,重启实时任务都不行.查看kafka t ...

  4. C#读写修改设置调整UVC摄像头画面-全景

    有时,我们需要在C#代码中对摄像头的全景进行读和写,并立即生效.如何实现呢? 建立基于SharpCamera的项目 首先,请根据之前的一篇博文 点击这里 中的说明,建立基于SharpCamera的摄像 ...

  5. c#结束练习题

    1.输入一个秒数,输出对应的小时.分钟.秒. 例:输入“4000“(秒),输出“1小时6分40秒”. 2.计算1-1/2+1/3-1/4+...-1/100的值. 3.写一个函数,对一个一维数组排序. ...

  6. python --- Socketserver N部曲(1)

    曲一 socketserver 是为了简化服务器端开发而产生的,是一个高级的标准库.(背景介绍完毕,开始干) 一些概念 来自源码的一张图片,简洁又FengSao +------------+ | Ba ...

  7. Mybatis事物浅谈

    本篇文章主要对Mybatis事物进行基础的介绍.先回顾JDBC事物,再了解Mybatis里面的事物应用. 1.JDBC的事务管理回顾 JDBC的事务管理是基于Connection对象实现的: 开启事务 ...

  8. VUE组件1

    1.组件基础 通过import引入.vue的文件,在componet中注册,在template中使用. 2.数据,方法和计算属性 注意点: 因为组件是用来复用的,且 JS 里对象是引用关系,如果组件中 ...

  9. Beego学习笔记6:分页的实现

    实现分页的效果 1>     分页的实现的业务逻辑 1->每个页面显示N条数据,总的数据记录数M,则分页的个数为M%N==0?M/N:M/N+1; 2->页面渲染分页的html部分 ...

  10. Beego 学习笔记三:Beego业务逻辑

    1>     打开main.go文件,查看代码 点击快捷键F12,进入beego.go文件,查看代码 2>     打开router.go文件,查看路由 3>     打开defau ...