摘要:
代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--#includestdio.h#includeunistd.h#defineONE_MB(1024*1024)intmain(void){longnum_procs;longpage_size;longnum_pages;longfree_pages;longlongmem;longlongfree_mem;num_procs=sysconf(_SC_NPROCESSORS_CONF);p
阅读全文
posted @ 2011-01-14 09:18
海王
阅读(6479)
推荐(0)
摘要:
http://blog.pfan.cn/wentao/10152.htmlprintf的格式控制的完整格式:% - 0 m.n l或h 格式字符下面对组成格式说明的各项加以说明:①%:表示格式说明的起始符号,不可缺少。②-:有-表示左对齐输出,如省略表示右对齐输出。③0:有0表示指定空位填0,如省略表示指定空位不填。④m.n:m指域宽,即对应的输出项在输出设备上所占的字符数。N指精度。用于说明输出的实型数的小数位数。为指定n时,隐含的精度为n=6位。⑤l或h:l对整型指long型,对实型指double型。h用于将整型的格式字符修正为short型。------------------------
阅读全文
posted @ 2011-01-13 12:15
海王
阅读(422)
推荐(1)
摘要:
KDE 下 khexedit Gnome 下 ghex 喜欢 VI 的可以用 bvi gvim/vim 也有二进制编辑模式, 用 :%!xxd :%!xxd -r 切换
阅读全文
posted @ 2011-01-13 11:45
海王
阅读(1491)
推荐(0)
摘要:
http://www.shocr.com/linux-for-line-batch-replace-spaces-regular/用三种解决方案来批量将换行改为空格,非常感谢柳城的帮助.1.tr2.shell3.awk
阅读全文
posted @ 2011-01-11 17:41
海王
阅读(10240)
推荐(0)
摘要:
函数setbuf()为流stream设置缓冲区buffer, 如果buffer为NULL则关闭缓冲. buffer应该指定为BUFSIZ个字符的长度.
阅读全文
posted @ 2011-01-10 11:58
海王
阅读(459)
推荐(0)
摘要:
http://www.ibm.com/developerworks/cn/linux/l-systemtap/index.html SystemTap 是监控和跟踪运行中的 Linux 内核的操作的动态方法。这句话的关键词是动态,因为 SystemTap 没有使用工具构建一个特殊的内核,而是允许您在运行时动态地安装该工具。它通过一个名为Kprobes 的应用编程接口(API)来实现该目的,本文将探...
阅读全文
posted @ 2011-01-07 10:09
海王
阅读(6862)
推荐(0)
摘要:
#! /bin/ash#read string from filefilecon=$(cat /root/surces/tmp/scrtxt) #get string follow ";DES:" filename=${filecon#*;DES:} if [ ${#filecon} == ${#filename} ] #string lenththen echo "no match" exit 1ficutpos=$(expr index "$filename" ';') #get positionlet cutpos=cutpos-1filename=${filename:0:$cutpo
阅读全文
posted @ 2011-01-05 16:16
海王
阅读(2257)
推荐(0)
摘要:
http://blog.chinaunix.net/u2/80710/showart_1933974.html
阅读全文
posted @ 2011-01-05 12:07
海王
阅读(605)
推荐(0)
摘要:
http://www.linuxidc.com/Linux/2010-12/30564.htm 写Bash Shell脚本,大小写转换通常这样做: str="This is a Bash Shell script." newstr=`tr '[A-Z]' '[a-z]' "$str"` 今天看bash的man page,发现有更简单的方法 转小写,只需要将变量名字declare -...
阅读全文
posted @ 2011-01-05 12:02
海王
阅读(21633)
推荐(0)
摘要:
atof(将字符串转换成浮点型数) 相关函数 atoi,atol,strtod,strtol,strtoul表头文件 #include stdlib.h定义函数 double atof(const char *nptr);函数说明 atof()会扫描参数nptr字符串,跳过前面的空格字符,直到遇上数字或正负符号才开始做转换,而再遇到非数字或字符串结束时('\0')才结束转换,并将结果返回。参数nptr字符串可包含正负号、小数点或E(e)来表示指数部分,如123.456或123e-2。返回值 返回转换后的浮点型数。附加说明 atof()与使用strtod(nptr,(char**)NULL)
阅读全文
posted @ 2011-01-04 16:25
海王
阅读(12032)
推荐(0)