![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell
wuweiweinanjing
这个作者很懒,什么都没留下…
展开
-
shell计时
#!/bin/bashstart=`date +%s`function a(){ while read a do echo $a sleep 1 done < $1}a "$1" end=`date +%s`(( time=end-start ))echo $time原创 2011-10-23 21:06:39 · 2560 阅读 · 1 评论 -
显示本机IP
ifconfig |grep "inet addr" |cut -d : -f 2 |sed 's/[a-zA-Z]//g' |grep -v "127.0.0.1"原创 2011-10-24 15:36:18 · 283 阅读 · 0 评论 -
selinux 状态修改为disabled
cd /etc/selinuxcat config |sed "s/\(SELINUX=\).*/\1disabled/" >bmv b config原创 2011-10-24 20:29:45 · 6852 阅读 · 0 评论 -
自动化脚本框架1
automatic(){ list=`echo $list | tr ' ' '\n' | sort -u | tr '\n' ' '` for test_num in $list do case $test_num in 1|2|3|4)原创 2011-10-24 13:17:00 · 498 阅读 · 0 评论 -
bash 脚本 实现文件的重命名
#!/bin/bashset -xif [ $# -lt 2 ];then echo "Usage:rename oldfilename newfilename"exit 1; fioldfilename=`dirname "$1"`/`basename "$1"`newfilename=`dirname "$2"`/`basename "$2"`if [ ! -原创 2011-11-01 22:42:50 · 2273 阅读 · 0 评论 -
shell实现寻找合适分区的脚本
MAXSIZE=`df -a | grep -v 'Filesystem' | grep "/file[1-9][0-9]*"; |awk '{print $4}' |sort -n -u -r |head -1` if [ $MAXSIZE -lt 15728640 ];then echo "15G must have!" exit 1 fifi list原创 2011-10-25 16:43:13 · 542 阅读 · 0 评论 -
bash shel脚本创建一个名为datafile的文本文件(除非已存在了这个文件)。文件中的每条记录都包含由冒号分隔的字段
创建一个名为datafile的文本文件(除非已存在了这个文件)。文件中的每条记录都包含由冒号分隔的字段。记录包含的字段是:a) 名和姓b)电话号码c)地址d)出生日期e)工资#!/bin/bashwhile true;doread name number address birth count set $name $number $address $birth原创 2011-11-01 23:30:56 · 3423 阅读 · 0 评论 -
sed手册
原始链接:http://phi.sinica.edu.tw/aspac/reports/96/96005/SED 手册中央研究院计算中心ASPAC 计划aspac@phi.sinica.edu.tw技术报告: 960051996年12月1日Version:1.0-----------------------------------------------------转载 2011-11-02 20:01:42 · 770 阅读 · 0 评论