摘要: 我们知道linux是模块化的内核。实现模块、利用kernel提供的接口,首先了解写模块的基本框架。下面的c文件就是最基本的框架,当然还有怎样添加一些符号变量,利用的module_param,没用上。 c文件printPid.c 1 #include <linux/kernel.h> 2 #include <linux/module.h> 3 #include <linux/init.h> 4 #include <linux/sched.h> 5 #include <linux/list.h> 6 7 static __init int 阅读全文
posted @ 2013-04-07 13:24 除e尘 阅读(1625) 评论(1) 推荐(1) 编辑
摘要: 先记录一种进度条实现: 1 #!/bin/bash 2 3 b='' 4 i=0 5 while [ $i -le 100 ] 6 do 7 printf "progress:[%-50s]%d%%\r" $b $i 8 sleep 0.1 9 i=`expr 2 + $i` 10 b=#$b11 done12 echo shell能够实现很多很酷的功能,有遇到都会记录下来。 阅读全文
posted @ 2013-04-07 12:54 除e尘 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 在此记录一下:11:30: ~$ script -t 2>record.log -a session.logIn command lines we input "script -t 2>record.log -a session.log".In the current directory,there are two files which have been made, calledrecord.logandsession.log.但是script此后在后台运行,然后我们就可以输入其他的command,我们的动作都会被script在record.log和sess 阅读全文
posted @ 2013-04-07 12:38 除e尘 阅读(733) 评论(0) 推荐(1) 编辑