易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux Shell 进度条显示函数(备忘)

1.点号进度显示code 1
#!/bin/sh
#输出"."进度条函数,兼容bsh、ksh、bash
#首先trap 1 2 3 15信号,重要
trap 'kill $BG_PID;echo;exit' 1 2 3 15
function dots
      {
      stty -echo >/dev/null 2>&1
      while true
      do
      echo -e ".\c"
      sleep 1
      done
      stty echo
      echo
      }
      #---------------------------------------------
      # 主程序开始
      #---------------------------------------------
      #首先使dots函数后台运行
      dots &
      BG_PID=$!
      #开始程序主体,本例中执行休眠10秒
      #注意必要时--8
2.井号进度显示code 2
#!/bin/sh
abort() {
   printf  "\033[m\n"
   exit
}
#donothing,justsimulatetimeconsume.
idle() {
   i=1
   sum=`date +%S`
   sum=`expr $sum \* $sum | cut -b1`
   sum=`expr $sum \* 10`
   while [ $i -le $sum ]
   do
       i=`expr $i + 2`
       trap abort 2
   done
}
proc() {
   begin=$1
   end=$2
   row=$3
   pos1=`expr $begin + 1`
   pos2=`expr $end - 1`
   mid=`echo "($begin+$end)/2-2" |bc`
   printf "\033[2J"
   printf "\033[${row};${begin}H["
   printf "\033[${row};${end}H]"
   echo ##########################$pos1 -le $pos2
   while [ $pos1 -le $p


相关文档:

Linux设备模型之input子系统详解

一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......

Linux内核及ARM的内存管理

欢迎回到Kernel中……
继续说__vet_atags函数,这个函数仍旧定义在arch\arm\kernel\head-common.s文件中:
/* Determine validity of the r2 atags pointer.  The heuristic requires
 * that the pointer be aligned, in the first 16k of physical RAM and
 * that the ATAG_CORE marker ......

linux下动态库与静态库

体验一下linux下编写和使用动态库与静态库,范例:helloworld程序。
首先编写静态库:
hellos.h
 #ifndef _HELLO_S_H
#define _HELLO_S_H
void prints(char *str);
#endif
 
hellos.c
#include "hellos.h"
#include <stdio.h>
void prints(char *str)
{
printf("print in sta ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号