![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SHELL脚本
infiltrators
这个作者很懒,什么都没留下…
展开
-
LINUX下截取字符串长度
echo ${str} | wc -L纯字符 exp length 'sdgsdg'原创 2016-10-31 09:12:14 · 438 阅读 · 0 评论 -
SHELL显示字符串最后一个字符
expr substr $xxx `expr length $xxx` `expr length $xxx`原创 2016-10-31 09:13:24 · 1604 阅读 · 0 评论 -
shell查询本机出口公网IP
curl http://members.3322.org/dyndns/getip get http://members.3322.org/dyndns/getipcat getip原创 2016-10-31 09:13:38 · 1225 阅读 · 0 评论 -
UNIX shell 字符串截取实例!!
read DATEmonth=$(echo $DATE | awk '{ print substr($1,5,2)}')year=$(echo $DATE | awk '{ print substr($1,1,4)}')day=$(echo $DATE | awk '{ print substr($1,7,2)}')echo $yearecho $monthecho $day原创 2016-10-31 09:10:22 · 1709 阅读 · 0 评论 -
shell截取函数2
read dateecho $date | cut -c 1-4year=$(echo $date | cut -c1-4)echo $year 可以根据这些写一个函数.原创 2016-10-31 09:10:24 · 211 阅读 · 0 评论 -
用shell截取sql数据
参照原帖http://blog.csdn.net/fantian830211/archive/2007/10/08/1815159.aspx 首先创建一个PROC 输出参数。shell中执行,在最后print 参数。 调用时直接引用上面的shell ,将结果赋值给变量。用引用tail函数截取后几行。赋值给变量并输出。#fun1sqlplus -s user/pass@dbv原创 2016-10-31 09:10:27 · 493 阅读 · 0 评论 -
shell 计算字符长度 echo $(expr …
read strecho $(expr length $str)原创 2016-10-31 09:10:32 · 604 阅读 · 0 评论 -
shell 输出数字左侧补0凑位数
printf "%02d\n" 8结果08 printf "%03d\n" 8结果008原创 2016-10-31 09:10:36 · 13197 阅读 · 0 评论 -
tar命令批量解压方法总结
(2010-05-24 17:48:46)由于linux的tar命令不支持批量解压,所以很多网友编写了好多支持批量解压的shell命令,收集了一下,供大家分享:第一:for tar in *.tar.gz; do tar xvf $tar; donefor tar in *.tar.bz2; do tar xvf $tar;done第二:用tar命令批量解压某个文件夹下所有的tar.g原创 2016-10-31 09:12:38 · 2986 阅读 · 0 评论 -
shell脚本md5校验方法
find file*.gz -print|xargs md5sum|sort >file.md5.local数据源md5文件为 file.md5本地md5校验文件为 file.md5.local以下语句判断md5.local是否一致diff -r file.md5 file.md5.localif [ $? -ne 0 ];thenecho "数据下载异常或者MD5校验未通过"原创 2016-10-31 09:12:36 · 7274 阅读 · 0 评论 -
AWK命令详解(大全)
什么是awk? 你可能对UNIX比较熟悉,但你可能对awk很陌生,这一点也不奇怪,的确,与其优秀的功能相比,awk还远没达到它应有的知名度。awk是什么?与其它大多数UNIX命令不同的是,从名字上看,我们不可能知道awk的功能:它既不是具有独立意义的英文单词,也不是几个相关单词的缩写。事实上,awk是三个人名的缩写,他们是:Aho、(Peter)Weinberg和(Brain)Kerni原创 2016-10-31 09:12:33 · 488 阅读 · 0 评论 -
统计文本中某值字段数量-cat-awk-s…
一、取出/etc/passwd文件中shell出现的次数问题:下面是一个/etc/passwd文件的部分内容。题目要求取出shell并统计次数,shell是指后面的/bin/bash,/sbin/nologin等,如下面/bin/bash出现12次,/sbin/nologin出现3次。hyn:x:525:500::/home/hyn:/bin/bash ljlxx:x:526:原创 2016-10-31 09:12:30 · 2061 阅读 · 0 评论 -
shell通配符
网友看法: (总结精辟!) 通配符是系统level的 而正则表达式需要相关工具的支持: egrep, awk, vi, perl。在文本过滤工具里,都是用正则表达式,比如像awk,sed等,是针对文件的内容的。通配符多用在文件名上,比如查找find,ls,cp,等等。 通配符 在您日常的 Linux 使用中,有很多时候您可能需要一次对多个文件系统对象执行单一操作原创 2016-10-31 09:12:24 · 7666 阅读 · 0 评论 -
shell date命令详解
使用方式 : date [-u] [-d datestr] [-s datestr] [--utc] [--universal][--date=datestr] [--set=datestr] [--help] [--version] [+FORMAT][MMDDhhmm[[CC]YY][.ss]] 说明 : date可以用来显示或设定系统的日期与时间,在显示方面,使用者可以设定欲显原创 2016-10-31 09:12:22 · 272 阅读 · 0 评论 -
asynch descriptor resi…
在11.2.0.1和11.2.0.2版本中有bug9829397和该等待事件有关,你可以参考一下,你也可以通过修改参数DISK_ASYNCH_IO=false来解决,该bug在11.2.0.3中被fixed。原创 2016-10-31 09:13:18 · 218 阅读 · 0 评论