随笔分类 -  Bash

bash Shell
check broken links
摘要: 阅读全文
posted @ 2018-08-15 11:56 卢伸乐 阅读(102) 评论(0) 推荐(0)
Bash Shell脚本--复制程序(命令)到指定目录下,同时将其所依赖的库文件复制到对应的目录
摘要:1 #!/bin/bash 2 # 3 target=/mnt/sysroot 4 [ -d $target ] || mkdir /mnt/sysroot 5 6 read -p "A command:" command 7 8 libcp() { 9 for lib in $(ldd $1 | grep -o "[^[:space:]]*/lib[^[:spac... 阅读全文
posted @ 2017-12-06 18:52 卢伸乐 阅读(3074) 评论(0) 推荐(0)
编译安装BIND (Berkeley Internet Name Domain)
摘要:The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) 一.编译安装 1.获取源码 http://www.isc.org/ 2.编译并安装 ~]# tar -zxvf bind-X.X.X.tar.gz ~]# cd bin 阅读全文
posted @ 2017-11-14 14:07 卢伸乐 阅读(819) 评论(0) 推荐(0)
bash shell脚本,判断某一网段的主机是否在线,将其统计出来,并将结果保存的相应的文件中
摘要:以47.94.215.0/24网段为例,判断该网段内所有主机在线与否,以能ping通视为在线,反之离线。脚本名为ping.sh 将其结果保存至/tmp/ping目录下,在线主机的保存文件为/tmp/ping/uphosts.ttx,离线主机的保存文件为/tmp/ping/downhosts.txt。 阅读全文
posted @ 2017-11-14 10:59 卢伸乐 阅读(978) 评论(0) 推荐(0)
bash shell 生成10个随机数,并用冒泡排序法将其升序排序
摘要:1 #!/bin/bash 2 #__author__:lushenle 3 #description:Generaye 10 random numbers and sort 4 #Version:0.0.1 5 # 6 declare -a nums 7 declare -i t 8 for i in {0..9};do 9 nums[$i]=$RANDOM 10 ... 阅读全文
posted @ 2017-11-02 16:47 卢伸乐 阅读(1708) 评论(0) 推荐(0)