摘要:
>>> import datetime >>> d1 = datetime.datetime(2005, 2, 16) >>> d2 = datetime.datetime(2004, 12, 31) >>> (d1 - d2).days 上例演示了计算两个日期相差天数的计算 import date 阅读全文
posted @ 2020-09-01 14:16
chengxuyonghu
阅读(1637)
评论(0)
推荐(0)
摘要:
方法1 #!/usr/bin/env bashdate1="$1"date2="$2" echo "date1: $date1"echo "date2: $date2" tempdate=`date -d "-0 day $date1" +%F` enddate=`date -d "-0 day $ 阅读全文
posted @ 2020-09-01 14:10
chengxuyonghu
阅读(478)
评论(0)
推荐(0)
摘要:
IBM共享磁盘双机系统的启动 启动cluster 在主机上使用smit clstart 或者运行 # /usr/sbin/cluster/etc/rc.cluster -boot -N -i 命令启动cluster 先启动的节点将成为主节点,将自动获得浮动IP,监控程序等资源 在备机上使用smit 阅读全文
posted @ 2020-09-01 14:03
chengxuyonghu
阅读(1152)
评论(0)
推荐(0)
摘要:
主要查看硬件的永久性报错 #errpt -dH | pg 软件的永久性报错 #errpt -dS | pg 还有系统又没又报警灯(如果不正常,在后面的帖子将会细讲) 第三:机器的序列号:#uname -Mu 第四:操作系统版本:#oslevel -r 注:又时候不能使用是因为系统版本低的原因 第五: 阅读全文
posted @ 2020-09-01 11:39
chengxuyonghu
阅读(1297)
评论(0)
推荐(0)
摘要:
1. $# 传递到脚本的参数个数 2. $* 以一个单字符串显示所有向脚本传递的参数变量。与位置变量不同,此选项参数可超过9个 3. $$ 脚本运行的当前进程ID号 4. $! 后台运行的最后一个进程的进程ID号 5. $@ 与$#相同,但是使用时加引号,并在引号中返回每个参数 6. $- 显示sh 阅读全文
posted @ 2020-09-01 11:00
chengxuyonghu
阅读(468)
评论(0)
推荐(0)
摘要:
root@test ~]# ping 192.168.2.1 -c 10 | awk '{ print $0"\t" strftime("%H:%M:%S",systime()) } 'PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. 10:3 阅读全文
posted @ 2020-09-01 09:18
chengxuyonghu
阅读(1663)
评论(0)
推荐(0)
摘要:
shell中截取字符串的方法有很多中, ${expression}一共有9种使用方法。 ${parameter:-word} ${parameter:=word} ${parameter:?word} ${parameter:+word} 上面4种可以用来进行缺省值的替换。 ${#parameter 阅读全文
posted @ 2020-09-01 09:15
chengxuyonghu
阅读(525)
评论(0)
推荐(0)
摘要:
shell脚本实现将文件中的几行输出合并成一行显示 现在有一个文件aa.txt ,其实现格式如下,而我想实现的结果是192.168.1.17 down [root@localhost shell]# cat aa.txt192.168.1.17down192.168.1.103open192.168 阅读全文
posted @ 2020-09-01 09:12
chengxuyonghu
阅读(1219)
评论(0)
推荐(0)
摘要:
#!/usr/bin/env bash #输入参数 1=年份 2=开始月份 3=结束月份 for i in `seq -w $2 $3`; do #参数1为指定的年份 year=$1 echo $year monthday=${year}${i}01 echo $monthday #产生每月第一天 阅读全文
posted @ 2020-09-01 09:10
chengxuyonghu
阅读(859)
评论(0)
推荐(0)
摘要:
shell版本#!/bin/bashfor i in `cat /home/haoren/iplist20171214.txt`do (sleep 1;)|telnet $i 80 2>&1 |grep "Connected to $ip$i">/dev/null 2>&1 if [ $? == 0 阅读全文
posted @ 2020-09-01 09:09
chengxuyonghu
阅读(171)
评论(0)
推荐(0)
浙公网安备 33010602011771号