文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > shell脚本总结
侵权投诉

shell脚本总结

0000/0.000000/1/1397/20110106234000/0/20110106231306/0/0/
13643452377/01/0/0/000/000/000/66710/2011010/vc/8.400000/0.000000/0.000000/9.600000/0.000000/0.000000/1/1397/20110106234000/0/20110106231306/0/0/

cfg_file=$1
file=$2
cat $file | awk -F "/" -v cfg_file=$cfg_file '
BEGIN{
while(getline line < cfg_file){
split(line,fileds," ");
serial=fileds[1]+1;
value[serial]=fileds[2];
line_number=serial;
}
i=1;
while(i<=line_number){
printf value[i]"|";
i++;
}
printf "\n";
}
{
a=1;
while(a<NF){
printf $a"|";
a++;
}
printf "\n";
}
'



config_path="/work11/ruanxingke/diff_shell/config"
sys=` ls ${config_path}/feeconfig.bill.??` | awk -F "/" '{printf "%s,",$NF}'
file=$1
awk -v sys=sys -v config_path=config_path 'BEGIN{
i=1;
split(sys,sys_type,",");
while(sys_type[i])
{
config_file=sprintf("%s%s",config_path,sys_type[i]);
j=0;
while(getline code < config_file)
{
split(code,filed," ");
sys_filed=sprintf("%s,%s",sys_type[i],filed[1]);
S[sys_filed]=filed[2];
L[sys_filed]=filed[3];
}
j++;

}
}


#将sg话单以批价bill格式解析,然后以经分传输bill格式输出
CB1-billapp1:/backup11>cat deal.sh
deal()
{
awk '{
system_type =substr($0, 0 +3, 2 );
seg_num =substr($0, 2 +3, 20 );
sm_type =substr($0, 22 +3, 2 );
msisdn =substr($0, 24 +3, 15 );
other_party =substr($0, 39 +3, 24 );
start_datetime =substr($0, 63 +3, 14 );
end_datetime =substr($0, 77 +3, 14 );
other_user_type =substr($0, 91 +3, 2 );
send_status =substr($0, 93 +3, 4 );
priority =substr($0, 97 +3, 1 );
msg_length =substr($0, 98 +3, 3 );
gateway_code =substr($0, 101+3, 6 );
f_gateway_code =substr($0, 107+3, 6 );
other_gateway =substr($0, 113+3, 6 );
sm_center_code =substr($0, 119+3, 11 );
user_type =substr($0, 130+3, 1 );
home_area_code =substr($0, 131+3, 4 );
fee1 =substr($0, 135+3, 7 );
old_fee1 =substr($0, 142+3, 7 );
favour_fee1 =substr($0, 149+3, 7 );
file_name =substr($0, 156+3, 40 );
deal_time =substr($0, 196+3, 12 );
discount_type =substr($0, 208+3, 5 );
discount_order =substr($0, 213+3, 5 );
present_info =substr($0, 218+3, 7 );
sum_present_info =substr($0, 225+3, 9 );
group_id =substr($0, 234+3, 15 );
product_code

上一页第4页

热门文档

相关文档

  • shell脚本学习笔记总结

    shell脚本学习笔记总结_互联网_IT/计算机_专业资料。最新版的shell脚本学习笔记,对嵌入式Linux的学习很有帮助Shell 脚本编程学习笔记 2013 年 5 月 2 日 追风~...

  • Shell脚本测试总结

    Shell脚本测试总结_计算机软件及应用_IT/计算机_专业资料。Shell脚本测试总结1. 脚本测试的苦难因为脚本使用的自由度很大,对于程序员限制很少,功能实现的随意性给...

  • LINUX Shell脚本介绍总结

    LINUX Shell脚本介绍总结_计算机软件及应用_IT/计算机_专业资料。LINUX Shell脚本介绍总结Shell脚本介绍 Shell脚本介绍 脚本语言是不需要事先编译,在执行时才直 接...

  • LINUX_Shell脚本介绍总结

    输入文字 Last Line Mode 主要功能:搜索或替换、存保存及结束 按q、pi、wq键 回到提示符 Shell脚本介绍创建shell脚本 指定以bash shell执行此文件 在vi输入下列...

  • Shell脚本介绍总结

    shell脚本介绍总结shell脚本介绍总结隐藏>> Shell脚本介绍 ? 脚本语言是不需要事先编译,在执行时才直 接解释每一行程序的语言。 ? 具有接受命令行参数、用户输入...

  • Shell脚本 编写总结

    Shell 脚本 编写总结 1. 文本操作 1) 获得文件所有字符内容 sed ‘np’ /path/filename (n 表示任意行号) cat /path/filename awk ‘{print}’ /path/...

  • 自己总结的shell脚本学习笔记(未完待续)

    自己总结的shell脚本学习笔记(未完待续)_互联网_IT/计算机_专业资料。关于shell脚本编程 比较全的资料 自己总结的Shell 脚本编程学习笔记 2013 年 4 月 27 日 ...

  • 常用shell脚本命令总结

    常用shell脚本命令总结_计算机软件及应用_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档常用shell脚本命令总结_计算机软件及应用_IT/计算机_专业资料。10...

  • 常用shell脚本命令总结

    常用shell脚本命令总结常用shell脚本命令总结隐藏>> 1,显 示包含文字 aaa 的下一行的内容: sed -n '/aaa/{n;p;}' filename 2,删 除当前行与下一行的...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email