shell脚本
减少时间
slyybw
这个作者很懒,什么都没留下…
展开
-
shell脚本进阶
shell脚本进阶bash条件判断条件测试类型整数测试字符测试文件测试条件测试的表达式[ expression ][root@localhost ~]#[ 1 -le 2 ][root@localhost ~]#echo $?0[root@localhost ~]#[[ expression ]][root@localhost ~]#[[ 1 -le 2 ]][root@localhost ~]#echo $?0[root@localhost ~]#tes原创 2022-03-31 10:39:05 · 99 阅读 · 0 评论 -
shell脚本多实例部署mysql
shell脚本多实例部署mysql创建一个目录,用来存放脚本和安装包[root@localhost opt]# mkdir mysql[root@localhost opt]# cd mysql/[root@localhost mysql]# mkdir packages[root@localhost mysql]# touch install.sh[root@localhost mysql]# lsinstall.sh packages下载好对应的安装包[root@localhost原创 2022-01-03 19:14:18 · 852 阅读 · 4 评论 -
shell脚本基础
shell脚本基础变量什么是变量?变量可以通过变量名访问,变量通常是可以变化的量变量名称注意事项只能包含字母、数字、下划线,并且不能以数字开头[root@localhost ~]# a_3=4[root@localhost ~]# echo $a_34[root@localhost ~]# 3_a=4-bash: 3_a=4: 未找到命令不应该跟系统中已有的环境变量重名,尽量不要全部使用大写,尽量不要用“_”下划线开头//系统角色都是大写字母组成[root@localhost ~原创 2022-01-03 19:10:22 · 488 阅读 · 0 评论 -
shell脚本实现部署lamp和lnmp
shell脚本实现部署lamp和lnmp创建一个目录,用来存放脚本和安装包[root@localhost ~]# mkdir /scripts[root@localhost ~]# cd /scripts/[root@localhost scripts]# tree.└── services ├── install.sh └── packages ├── apr-1.7.0.tar.gz ├── apr-util-1.6.1.tar.gz原创 2022-01-03 17:12:50 · 696 阅读 · 0 评论 -
shell脚本部署免密登录
shell脚本部署免密登录创建一个目录,用来存放脚本[root@localhost scripts]# tree.├── host└── ssh.sh0 directories, 2 files编写脚本[root@localhost scripts]# cat ssh.sh #!/bin/bashset -eyum -y install expectif [ ! -f ~/.ssh/id_rsa ];then ssh-keygen -t rsa -P "" -f ~/.ssh原创 2022-01-03 17:04:57 · 342 阅读 · 0 评论 -
shell脚本部署nginx
shell脚本部署nginx创建一个目录,用来存放脚本和安装包[root@localhost nginx]# tree.├── install.sh└── packages └── nginx-1.20.1.tar.gz1 directory, 2 files下载好对应的安装包[root@localhost packages]# wget https://nginx.org/download/nginx-1.20.1.tar.gz[root@localhost packages原创 2022-01-03 17:00:56 · 741 阅读 · 0 评论 -
shell脚本部署lamp
shell脚本部署lamp创建一个目录,用来存放脚本和安装包。[root@localhost ~]# cd /opt/[root@localhost opt]# lslamp[root@localhost opt]# cd lamp/[root@localhost lamp]# lsinstall.sh packages下载好对应的安装包[root@localhost lamp]# lslamp.sh packages[root@localhost lamp]# ls packag原创 2022-01-03 16:56:05 · 642 阅读 · 0 评论