51
Dev开发社区
首页
文章
问答
工具
搜索
登录
注册
#抢票脚本
shell脚本中:单引号和双引号的区别
前面我们还留下一个疑问,定义变量时,变量的值可以由单引号''包围,也可以由双引号""包围,它们到底有什么区别呢?不妨以下面的代码为例来说明:#!/bin/bashurl="http://c.biancheng.net"website1='C语言中文网:${url}'website2="C语言中文网:${url}"ech...
代码星球
·
2020-08-24
shell
脚本
单引号
引号
双引
Shell脚本中执行sql语句操作mysql
对于自动化运维,诸如备份恢复之类的,DBA经常需要将SQL语句封装到shell脚本。本文描述了在Linux环境下mysql数据库中,shell脚本下调用sql语句的几种方法,供大家参考。对于脚本输出的结果美化,需要进一步完善和调整。以下为具体的示例及其方法。1、将SQL语句直接嵌入到shell脚本文件中 复制...
代码星球
·
2020-08-24
Shell
脚本
执行
sql
语句
nginx的抓取客户端真实IP的判断脚本
root@nginx-01:/usr/local/nginx/conf/#catproxyheader.confif($proxy_add_x_forwarded_for~"^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})(.*)"){set$realip$1;}if($pr...
代码星球
·
2020-08-24
nginx
抓取
客户端
真实
IP
python中的pymongo连接脚本
author:headsenchendate:2019-04-12 17:39:12 先安装python3,pymongo[root@localhostmnt]#cat/root/python-install.sh#!/bin/bashyum-yinstallzlib-develbzip2-deve...
代码星球
·
2020-08-24
python
中的
pymongo
连接
脚本
mysql5.6.35的安装脚本
#!/bin/bashfunctionhelp()(cat<<EOF$0[-h]$0-c<CharaterSet>EOFexit1)-------------------------------------------#判断用户是否存在,不存在就新增mysql用户check_and_add_us...
代码星球
·
2020-08-24
mysql5.6.35
安装
脚本
cmdb安装脚本
#!/bin/bashcd/tmpyum-yinstalldos2unixcurl-Ohttp://119.254.200.5:7001/downloadversion/1.1.78/cmdbagent-1.1.78-20180712.tar.gztar-zxvfcmdbagent-1.1.78-20180712.ta...
代码星球
·
2020-08-24
cmdb
安装
脚本
parted分区脚本
#!/bin/bash#Usedtofomat6disksPATH=/bin:/sbin:/usr/bin:/usr/sbinexportPATHdisk_to_parted="$1"if[$#==0];thenecho"nodisktoparted,example/dev/sdb"exitelseecho"/n/n*...
代码星球
·
2020-08-24
parted
分区
脚本
Python拷贝文件脚本
author:headsenchendate:2018-12-06 17:56:58copy_file.py#!/usr/bin/envpythonfromsysimportargvfromos.pathimportexistsscript,from_file,to_file=argvprint("Copyi...
代码星球
·
2020-08-24
Python
拷贝
文件
脚本
ntpdate自动对准时间的脚本
author:headsen chendate:2018-10-09 19:50:15#!/bin/bashyum-yinstallntpdate/usr/sbin/ntpdatentp.api.bz>/dev/nullhwclock-wecho"11***/usr/sbin/ntpdaten...
代码星球
·
2020-08-24
ntpdate
自动
准时
间的
脚本
salt-ssh的批量脚本及使用方法
author:headsen chen date:2018-08-02 20:06:061,salt-ssh的安装: yum-yinstallepel-release yum...
代码星球
·
2020-08-24
salt-ssh
批量
脚本
使用方法
磁盘挂载自动分区脚本
自动分区脚本:cata.sh#!/bin/bashmkdir/data1echo"np1w"|fdisk/dev/vdc&&mkfs-text4/dev/vdc1 添加到自动挂载:catauto-mount.shecho"UUID=`ls-l/dev/disk/by-uuid|grepvdc1...
代码星球
·
2020-08-24
磁盘
挂载
自动
分区
脚本
tomcat启动脚本
author:headsenchendate:2018-04-10 16:05:05 [root@archtomcat-oss]#cattomcat.sh#!/bin/bashexportJAVA_HOME=/opt/jdk1.7.0_45exportJRE_HOME=${JAVA_HOME}/jr...
代码星球
·
2020-08-24
tomcat
启动
脚本
mysql的增量备份与全备的脚本
mysql全量备份、增量备份。开启mysql的logbin日志功能。在/etc/my.cnf文件中加入以下代码:[mysqld]log-bin="/home/mysql/logbin.log"binlog-format=ROWlog-bin-index="/home/mysql/logindex"binlog_cach...
代码星球
·
2020-08-24
mysql
增量
备份
全备
脚本
nginx的自动化安装和启停脚本
个人原创,转载请注明出处和作者,否则依法追究法律责任author:headsenchendate: 2018-03-07 14:39:11nginx_install.sh#!/bin/bashNGINX=nginx-1.9.3.tar.gzuseraddnginxyum-yinstallgcc*pc...
代码星球
·
2020-08-24
nginx
自动化
安装
启停
脚本
shell脚本基础知识
shell脚本基础知识author:headsenchen 2017-10-19 10:22:15 个人原创,根据老男孩教学视频及老男孩老师的shell编程书籍整理出来的,转载请注明。否则依法追究法律责任1,清除/VAR/LOG/MESSAGES日志的脚本#!/bi...
代码星球
·
2020-08-24
shell
脚本
基础知识
首页
上一页
...
16
17
18
19
20
...
下一页
尾页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他