#include#include#include#define random(x)
(rand()%x)void main(){ srand((int)time(0)); for(int x=0;x<10;x++)
printf("%d/n",random(100...
分类:
编程语言 时间:
2014-06-29 15:34:25
阅读次数:
302
echo
192.168.10.69>>ip.list-------------------------------------------#!/bin/bash#注意if和[]之间的空格rm
-f ~/fanr/shell/DiskUsageAlert/out.printout=$(cat ~/f...
分类:
系统相关 时间:
2014-05-28 14:54:26
阅读次数:
391
说有一个rand()函数,等概率生成1-7的随机数.利用这个函数,构造一个能生成1-10的随机数的函数;
//意思大家都懂就好,没说清的就按照想象的走我想只要输出的10个数概率相同就好,从宏观上看,这个函数的返回值每个都是1/10就好.int get10(){
srand((...
分类:
其他好文 时间:
2014-05-28 09:39:42
阅读次数:
257
这是一个清空系统日志的脚本:vim logmess_clean.sh#bin/bash
//该脚本所使用的shell解释器cd /var/log///切换到存放日志目录echo > messages//清空日志echo
"logmessages is clean"//脚本执行完成后输出“日志清空”[...
分类:
其他好文 时间:
2014-05-28 02:09:50
阅读次数:
320
系统环境变量的查看:[root@localhost ~]#
envHOSTNAME=localhost.localdomainSELINUX_ROLE_REQUESTED=TERM=xtermSHELL=/bin/bashHISTSIZE=1000SSH_CLIENT=192.168.7.105
5...
分类:
系统相关 时间:
2014-05-28 00:48:18
阅读次数:
415
1.安装 doxygen有两种获得 doxygen 的方法。可以下载预编译的可执行文件,也可以从
SVN 存储库下载源代码并自己编译。清单 1 演示的是后一种方法。清单 1. 安装和构建 doxygen 源代码bash-2.05$svn co
https://doxygen.svn.sourcefo...
分类:
编程语言 时间:
2014-05-28 00:04:06
阅读次数:
501
1 #!/bin/bash 2 #查询 3 echo -e 4 for i in `cat
id.txt` 5 do 6 A=`mysql -h10 -uw -p2012 -Ne "select Id,Name,User_Logindate from
info where Id=$i"`...
分类:
数据库 时间:
2014-05-27 18:08:04
阅读次数:
341
#!/bin/bash# Program to output a go source file
with user informationCURRENT_TIME=$(date +"%x %r %Z")cat <<
EOF/* Author:$USER CreatedAt:$CURRENT_TIME...
分类:
其他好文 时间:
2014-05-27 17:49:29
阅读次数:
283
#!/bin/bash# 用shell中的数组构造统计不同的组合个数.#
下面的组合有(1,6)(3,4)(5,5)(1,6)(5,5)(4,3)(1,8)#
不同的组合为(1,6)(3,4)(5,5)(4,3)(1,8)arrayLeft=(1 3 5 1 5 4 1)arrayRight=(6 ...
分类:
其他好文 时间:
2014-05-26 19:17:19
阅读次数:
409
ubuntu下/bin/sh的指向
ubuntu 下 /bin/sh 默认是dash,用ll /bin/sh就可以看出来sh是指向dash的链接,有时候会导致使用bash脚本的时候出问题。
如果遇到这个问题了,就要把sh指向bash。
用下面的命令把dash修改为bash
用sudo dpkg-reconfigure dash 选择否
查看当前的she...
分类:
其他好文 时间:
2014-05-25 21:31:45
阅读次数:
224