遍历目录中所有文件,并且统计文件类型。#!/bin/bash
#filename:filestat.sh
#set-x
if[$#-ne1];
then
echo$0basepath;
echo
fi
path=$1
declare-Astatarray;
whilereadline;
do
ftype=`file-b"$line"`
letstatarray["$ftype"]++;
done<<(find$path-typef-print)
ech..
分类:
其他好文 时间:
2014-06-28 00:16:08
阅读次数:
224
温馨提示 首先要安装postfix 或者 sendmail 等邮件服务器1.Apache#!/bin/bash#apache.shnc -w2 localhost 80 if[ $? -ne 0 ]then echo "apache is down,please check" | mail us.....
分类:
其他好文 时间:
2014-06-27 15:03:59
阅读次数:
256
@echo offset mydd=%date:~8,2%set myyy=%date:~0,4% set mymm=%date:~5,2%set fileName=d:\wf\eSupply_work\%myyy%%mymm%%mydd%echo %filename%if exist %filen...
分类:
其他好文 时间:
2014-06-27 13:59:14
阅读次数:
201
1.切换到用户目录cd ~2.新建一个文件,命名为opencv.sh 脚本如下:version="$(wget -q -O - http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | egrep -m1 -o '\"[0-9](\.[0-9])+' | cut -c2-)"
echo "Installing OpenCV"...
分类:
其他好文 时间:
2014-06-27 10:52:48
阅读次数:
262
转载请注明出处:http://www.openext.org/2014/06/lxc-erro1#tar zxvf lxc-xxx.tar#./autogen#./configure –prefix=/usr/local/lxc#make#make install#lxc-lsthe error:#echo “/usr/local/lxc/lib” >> /etc/ld.so.conf#ldcon...
分类:
其他好文 时间:
2014-06-27 08:36:38
阅读次数:
156
awk‘BEGIN{FS="[,:/%]"}{print$3"\n"$4}‘1.txt
分类:
其他好文 时间:
2014-06-27 06:55:14
阅读次数:
202
Linux下Shell脚本输出带颜色文字文本终端的颜色可以使用“ANSI非常规字符序列”来生成。举例:"echo-e\033[44;37;5mBLUE\033[0m""echo-e\033[44;37;5mBLUE\033[0mBLACK"需要修改的地方是红色带下划线的部分,其中[***m部分的内容换成下面的数字,后面的内容是自己想要上色的内..
分类:
系统相关 时间:
2014-06-27 06:37:51
阅读次数:
429
获取指定域名的IP地址:#!/bin/bash
if[$#-lt1];then
echo$0needaparameter
exit0
fi
ADDR=$1
TMPSTR=`ping${ADDR}-c1|sed‘1{s/.*(\([^]*\))56.*/\1/;q}‘`
#TMPSTR=`ping${ADDR}-c1|sed‘1{s/[^(]*(//;s/).*//;q}‘`
echo${TMPSTR}
分类:
其他好文 时间:
2014-06-27 06:17:08
阅读次数:
928
系统环境:[root@salt_serverhome]#ifconfigeth0|grep"inetaddr:"|awk-F:‘{print$2}‘|awk‘{print$1}‘
192.168.100.228
[root@salt_serverhome]#cat/etc/redhat-release
CentOSrelease6.3(Final)
[root@salt_serverhome]#uname-r
2.6.32-279.el6.x86_64
[root@salt_serverhome]#..
分类:
其他好文 时间:
2014-06-27 06:12:03
阅读次数:
311