随机访问web
脚本模拟出随机出访问日志
计算小数:echo ‘1.2*2’|bc或者保留2位小数echo 'scale=2;0.1*2'|bc
echo ‘1.2*2’|bc++++++++++++++++ 数字比较方式1:agm1=50agm2=60if [ 3 -eq 3 -a ${agm1} -ne ${agm2} -a ${agm2} -gt ${agm1} -a ${agm1} -ge 50 -a ${agm1} -lt ${agm2} -a ${agm2} -le 60 -o 4 -gt 3
#!/bin/bash#return error code#0: success#1: parameter error#6: custom.log file is empty#7: cut file error#8: up log file successTAR_DIR_FILE_MAX=30MAIN_LOG_FILE_MAX=1024MAIN_LOG_NAME='custom.log
跑临时脚本
wget http://www.cpan.org/modules/by-module/DBI/DBI-1.623.tar.gz tar -zxvf DBI-1.623.tar.gz cd DBI-1.623 perl Makefile.PL make make install wget http://www.cpan.org/modules/by-module/DBD/DBD-mysql-4.022.tar.gz tar zxf DBD-mysql-4.022.tar.gz cd DBD-mysql-4.022 perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config make && make install 案例: 连接数据库 #!/usr/bin/perl use strict; use DBI; my $dbname="mysql"; my $location="127.0.0.1"; my $port="3306"; my $datab
#!/usr/bin/perl my $message = ''; $message = supperMonitor(); @strArr=split(/\n/,$message); my $i=1; my $count=1; my $msg=''; while($count<=@strArr){ $msg .= "====$strArr[$count-1]==\n"; if($i==5){ print "==$i=$msg==\n"; $msg=''; $i=0; } $i++; $count++; }
####1 安装wget http://www.cpan.org/modules/by-module/DBI/DBI-1.623.tar.gztar -zxvf DBI-1.623.tar.gzcd DBI-1.623perl Makefile.PLmakemake installwget http://www.cpan.org/modules/by-module/DBD/DBD-mysql-4.
find-xargs 查找删除和拷贝
#!/usr/bin/perluse strict;use Redis;my $redis = Redis->new(server => '192.168.119.131:8080');my $num;my $i;for ($i=1;$i<10000000;$i++){ $num = hash($i); $redis->sel
#!/usr/bin/perluse strict;my $file="./test.txt";if( -f $file and -z _){ print "==empty==\n"}else{ print "==yes==\n";}
#!/usr/bin/perluse strict;use File::Slurp;use Proc::Fork;my $code=read_file('./dig.pl');while(1){ run_fork{ child{ eval(
#!/usr/bin/perl#use warnings;use strict;use Parallel::ForkManager;use JSON::XS;use Net::DNS::Nslookup;use Net::Nslookup;use POSIX qw(strftime);use Digest::MD5;`[ -d ./logs ] || mkdir logs`;my $listPat
#!/usr/bin/perlmy $tmp = "ye_qing";my @name = split("_",$tmp);my $list = "==$name[0]==$name[1]==\n";print $list;my @ye=(1,2,3,4);my @qing=(1,2,@ye,4,5,6);$scount = @qing;print "==sum:$scount==\n";prin
#### perl安装 wget http://www.cpan.org/src/5.0/perl-5.22.0.tar.gz tar -zxf perl-5.22.0.tar.gz cd perl-5.22.0 &nbs
#!/bin/bash#author yeqing <492980936@qq.com>#date 2015-07-19 10:26:28function digThread(){ yesNum=0 noNum=0 i=0  
#!/bin/bash#author yeqing <492980936@qq.com>#date 2015-07-19 10:26:28yesNum=0noNum=0i=0data=''yesList=()noList=()date=`date +"%Y-%m-%d %H:%M"`while read url;
时间date
md5校验
方法一:压缩:gzip ye.conf 或者 gzip -9 -c ye.conf > yeqing.conf.gz(最佳压缩比例)解压:gzip -d ye.conf.gz方法二:只打包不压缩: tar -cf /tmp/ye.tar /application/tools解压:tar -xf /tmp/ye.tar打包并压缩: tar -zc
[root@mysql1 tmp]# cat test.sh#!/bin/bashfor fileName in `ls /tmp/fastweb/`do echo `/bin/date` ${fileName}--start------------ ttl=`head -1 /tmp/fastweb/${fileName}|awk '{print
#!/bin/bash for fileName in `ls /tmp/fastweb/` do echo `/bin/date` ${fileName}--start------------ &
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号