随笔分类 -  Shell脚本案例

摘要:有文件a.txt,内容为: abc有文件b.txt,内容为: 123现需要将a.txt和b.txt合并为c.txt,内容为: a1b2c3使用下面的脚本,其中$line是要交叉合并的文件行数。 for ((i=1;i<=$line;i++));docat a.txt | tail -n +$i |h 阅读全文
posted @ 2022-12-11 21:12 呼长喜 阅读(521) 评论(0) 推荐(0) 编辑
摘要:脚本内容: #!/bin/sh #################################################### Used to obtain Zookeeper middleware service performance information# script by sh 阅读全文
posted @ 2022-11-19 00:26 呼长喜 阅读(192) 评论(0) 推荐(0) 编辑
摘要:脚本内容: #!/bin/sh #################################################### Used to obtain the Zookeeper middleware service status# script by shell# writed b 阅读全文
posted @ 2022-11-19 00:25 呼长喜 阅读(70) 评论(0) 推荐(0) 编辑
摘要:脚本内容: #!/bin/sh #################################################### Used to monitor the number of process keywords # script by shell# writed by Deliv 阅读全文
posted @ 2022-11-19 00:24 呼长喜 阅读(52) 评论(0) 推荐(0) 编辑
摘要:脚本内容: #!/bin/sh #################################################### Script to handle execution timeout states# script by shell# writed by Deliver# hu 阅读全文
posted @ 2022-11-19 00:23 呼长喜 阅读(145) 评论(0) 推荐(0) 编辑
摘要:脚本如下: #!/bin/sh #################################################### used to Restart the zabbix_agentd service# script by shell# writed by Deliver# hu 阅读全文
posted @ 2022-10-21 15:06 呼长喜 阅读(346) 评论(0) 推荐(0) 编辑
摘要:脚本如下: #!/bin/sh #################################################### used to Collection CPU Top10 Informatiom# script by shell# writed by Deliver# huc 阅读全文
posted @ 2022-10-21 14:58 呼长喜 阅读(311) 评论(0) 推荐(0) 编辑
摘要:脚本如下: #!/bin/sh #################################################### used to Collection MEMORY Top10 Informatiom# script by shell# writed by Deliver# 阅读全文
posted @ 2022-10-21 14:57 呼长喜 阅读(155) 评论(0) 推荐(0) 编辑
摘要:执行用户:mysql 脚本内容: #! /bin/sh OSCheckCentOS8=`cat /etc/redhat-release 2>/dev/null |awk '{print $4}' |awk -F"." '{print $1}'`OSCheckSuse=`cat /etc/issue 阅读全文
posted @ 2022-07-03 19:00 呼长喜 阅读(32) 评论(0) 推荐(0) 编辑
摘要:执行方式:sh scripts.sh scriptsfile="Linux_Memory.sh" check="failed/true" 脚本参数详解: scriptsfile="" zbx二次开发监控脚本 check="" failed(执行)true(查看) 脚本内容: #! /bin/sh s 阅读全文
posted @ 2022-07-03 18:14 呼长喜 阅读(141) 评论(0) 推荐(0) 编辑
摘要:执行方式:sh scripts.sh hostname="TEST01" ip="198.145.0.122" check="failed/true" 脚本参数详解: hostname="" 执行主机的主机名 ip="" 执行主机的IP地址 check="" failed(执行)true(查看) 脚 阅读全文
posted @ 2022-07-03 17:40 呼长喜 阅读(55) 评论(0) 推荐(0) 编辑
摘要:执行方式:sh scripts.sh hostname="TEST01" ip="198.145.0.122" check="failed/true" 脚本参数详解: hostname="" 执行主机的主机名 ip="" 执行主机的IP地址 check="" failed(执行)true(查看) 脚 阅读全文
posted @ 2022-07-03 17:21 呼长喜 阅读(235) 评论(0) 推荐(0) 编辑
摘要:2.1、什么是编程语言 编程语言是用来控制计算机的一系列指令(Instruction),它有固定的格式和词汇(不同编程语言的格式和词汇不一样)。就像我们中国人之间沟通需要汉语,英国人沟通需要英语一样,人与计算机之间进行沟通需要一门语言作为介质,即编程语言。 编程语言的发展经历了机器语言(指令系统)= 阅读全文
posted @ 2022-03-26 01:09 呼长喜 阅读(287) 评论(0) 推荐(0) 编辑
摘要:#脚本测试:window 回车是 \r\nlinux 回车是 \nyum install -y dos2unix (软件)命令:dos2unix 脚本名 处理 sh -x 与 set -x(开始) set +x(结束)显示脚本执行过程 一.变量 1.局部变量:只在一个范围内使用(普通变量)File= 阅读全文
posted @ 2020-08-07 18:15 呼长喜 阅读(306) 评论(0) 推荐(0) 编辑
摘要:color fdC:\Windows\System32\drivers\etchostscd C:\ump\zabbix\confzabbix_agentd.conf if %processor_architecture% EQU x86 copy /y C:\ump\zabbix\bin\win3 阅读全文
posted @ 2020-01-20 15:48 呼长喜 阅读(219) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bashMYSQL=/usr/bin/mysqlMYSQL_HOST=localhost MYSQL_USER=rootMYSQL_PASSWORD=123456CHECK_TIME=3#mysql is working MYSQL_OK is 1 , mysql down MYSQL 阅读全文
posted @ 2020-01-20 14:57 呼长喜 阅读(317) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bashsource /etc/profile echo "--start cas"cd /opt/itump/itumpsub/tomcat-cas/bin./startup.sh &sleep 2 echo "--start a-center"cd /opt/itump/itump 阅读全文
posted @ 2020-01-20 14:54 呼长喜 阅读(1095) 评论(0) 推荐(0) 编辑
摘要:portal_mysql_backup.sh: #!/bin/bash#chmod 700 ${PATH}/portal_mysql_backup.sh#crontab -e (1 3 * * * ${PATH}/portal_mysql_backup.sh) red='\e[0;31m' # 红色 阅读全文
posted @ 2020-01-20 14:52 呼长喜 阅读(380) 评论(0) 推荐(0) 编辑
摘要:待更新 阅读全文
posted @ 2020-01-20 14:46 呼长喜 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-01-20 14:43 呼长喜 阅读(979) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示