⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 look1

📁 ksh 实现的基于hpux下的性能数据以及故障的采集程序。可以作为新手练手使用
💻
字号:
#!/bin/ksh#@(#)  查询字典中的字段含义、if [[ $# != 2 ]] then   echo 用法: look1 中文或英文  交易终端类型 如 TT,ST   exit 1finame=$1if [[ `expr "$1" : '[a-zA-Z0-9_.]*' ` = ${#1} ]] then   name=`echo $1 | tr "[:upper:]" "[:lower:]"`fidigit=0if [[ `expr "$1" : "[[:digit:]]*" ` = ${#1} ]] then  digit=1fitype=$2type=`echo $type | tr "[:lower:]" "[:upper:]"`[[ $type = TT ]] && DictFile=$HOME/dict/dict.dat [[ $type = TT ]] || DictFile=$HOME/dict/dict.dat [[ $type = ST ]] && DictFile=$HOME/dict/dict.handsome [[ $type = SE ]] && DictFile=$HOME/dict/dict.handsome[[ $type = IB ]] && DictFile=$HOME/dict/dict.ibs[[ $type = AG ]] && DictFile=$HOME/dict/dict.dat[[ $type = EX ]] && DictFile=$HOME/dict/dict.dat[[ $type = KN ]] && DictFile=$HOME/dict/dict.kernel[[ $type = UM ]] && DictFile=$HOME/dict/dict.fund[[ $type = CM ]] && DictFile=$HOME/dict/dict.cmif [[ $digit = 0 ]] then  nawk '    BEGIN {     label=0;   }   $1!~/^#/ {     $2 = tolower( $2 );   }    $1~/'"$name"'/ || $2~/'"$name"'/ {      label = 1;      printf("%30s  %12s %20s    %s\n", $1, $2,$3,$4) ;      while( 1 ){          if( getline == 0 )            break;          if( $1~/^#/ || length( $0 ) == 0 )            print $0;          else {            $2 = tolower( $2 );            if( index( $1, "'"$name"'" ) || index( $2, "'"$name"'" ) ){              printf("%30s  %12s %20s    %s\n", $1, $2,$3,$4) ;              continue;            }            break;          }      }  }  END {    if( label == 0 )      print "'"$1"' 不在数据字典中 "  }  ' $DictFileelse  nawk '    BEGIN {     label=0;     nubr=0;   }   $1~/^#/ || length( $0 ) == 0 {     continue;   }   {     nubr++;     $2 = tolower( $2 );     if( nubr == '"$1"' ){       printf("%-8s %-12s  %-30s \n","'"$1"'", $2, $1) ;       label = 1;     }     if( label == 1 )       exit( 1 );  }  END {    if( label == 0 )      print "'"$1"' 不在数据字典中 "  }  ' $DictFilefi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -