撇嘴看天空

导航

2019年6月13日

linux 批量升级openssh8.0

摘要: updateopenssh.sh explujing=/home/updateopenssh.exp username=root password=123456 iplist="192.167.1.94192.167.1.95192.167.1.96192.167.1.97" port=22 for 阅读全文

posted @ 2019-06-13 19:06 撇嘴看天空 阅读(314) 评论(0) 推荐(0) 编辑

linux 批量关闭telnet

摘要: shutdown_telnet.sh explujing=/home/shutdown_telnet.exp username=root password=123456 iplist="192.167.1.1 192.167.1.2 " port=22 for ip in $iplist do $e 阅读全文

posted @ 2019-06-13 19:00 撇嘴看天空 阅读(168) 评论(0) 推荐(0) 编辑

linux 批量安装telnet脚本

摘要: install_telnet.sh explujing=/home/install_telnet.exp username=root passwd=123456 iplist="192.167.1.1192.167.1.2192.167.1.3 " port=23 for ip in $iplist 阅读全文

posted @ 2019-06-13 18:55 撇嘴看天空 阅读(260) 评论(0) 推荐(0) 编辑

批量添加linux 定时任务crontab -e

摘要: 脚本如下 crontab_add.sh explujing=/home/crontab_add.exp username=rootpassword=123456 iplist="192.168.3.101 192.168.3.102"port=22for ip in $iplistdo $explu 阅读全文

posted @ 2019-06-13 18:47 撇嘴看天空 阅读(1110) 评论(0) 推荐(0) 编辑

linux 实现excel vlookup

摘要: 脚本内容 vlookup.sh #!/bin/bashawk 'NR==FNR{a[$1]=$0;next}NR>FNR{if($1 in a)print $0"\t"a[$1]}' $1 $2 >vlookup_result [root@localhost/home/]#cat aa1 a e2 阅读全文

posted @ 2019-06-13 18:00 撇嘴看天空 阅读(1713) 评论(0) 推荐(0) 编辑

Shell脚本编程

摘要: shell脚本 Shell脚本编程 1shell脚本--简介 1.1格式要求:首行shebang(sharp bang)<==>#!机制 ​ #!/bin/bash(用于shell脚本) ​ #!/usr/bin/python(用于python脚本) ​ #!/usr/bin/perl(用于perl 阅读全文

posted @ 2019-06-13 16:14 撇嘴看天空 阅读(300) 评论(0) 推荐(0) 编辑

SHELL脚本--read命令

摘要: 1.1 shell read简介 要与Linux交互,脚本获取键盘输入的结果是必不可少的,read可以读取键盘输入的字符。 shell作为一门语言,自然也具有读数据的功能,read就是按行从文件(或标准输入或给定文件描述符)中读取数据的最佳选择。当使用管道、重定向方式组合命令时感觉达不到自己的需求时 阅读全文

posted @ 2019-06-13 16:11 撇嘴看天空 阅读(16919) 评论(1) 推荐(1) 编辑

SHELL脚本--数学运算和bc命令

摘要: 使用let、(())、$(())或$[]进行基本的整数运算,使用bc进行高级的运算,包括小数运算。其中expr命令也能进行整数运算,还能判断参数是否为整数,具体用法见expr命令全解。 其中let和(())几乎完全等价,除了做数学运算,还支持数学表达式判断,例如数值变量a是否等于3:let a==3 阅读全文

posted @ 2019-06-13 16:11 撇嘴看天空 阅读(1233) 评论(0) 推荐(0) 编辑

Linux中使用 if 、for、while等循环来写脚本

摘要: 这次来介绍一下Shell的基本语法: 一、注释 Shell中的注释标志是井号 "#",除了脚本文件第一行的#不是注释之外,其他地方出现#,则说明#开始,到本行的末尾都是注释 二、指定脚本解释器 一般每个Shell脚本文件的第一行都是指定脚本解释器 #!/bin/bash : 指定本脚本文件使用bas 阅读全文

posted @ 2019-06-13 16:03 撇嘴看天空 阅读(1169) 评论(0) 推荐(0) 编辑

linux for 循环

摘要: 循环结构(for)for 变量名 in 列表do? 循环体done列表生成方式:(1) 直接给出列表(2) 整数列表:? (a) {start..end}? (b) $(seq [start [step]] end)(3) 返回列表的命令? $(COMMAND)(4) 使用glob,如:*.sh(5 阅读全文

posted @ 2019-06-13 15:58 撇嘴看天空 阅读(1616) 评论(0) 推荐(0) 编辑