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

shell脚本总结

=substr($0, 249+3, 8 );
resv =substr($0, 257+3, 15 );
brand_code =substr($0, 272+3, 2 );
bill_month =substr($0, 274+3, 6 );
dealfile =substr($0, 280+3, 40 );
error_code =substr($0, 320+3, 20 );
info_fee1 =substr($0, 340+3, 60 );
bill_type =substr($0, 400+3, 1 );
acct_type =substr($0, 401+3, 1 );
favor_month =substr($0, 402+3, 8 );
newline =substr($0, 410+3, 1 );

printf("%-2s%-25s%-2s%-15s%-20s%-15s%-24s%-14s%-14s%-20s%-1s%-24s%-20s%-2s%-4s%-1s%-3s%-6s%-6s%-11s%-4s%-1s%7d%9d%7d%9d%7d%9d%-40s%-12s%-5s%-5s%-7s%-9s%-15s%-8s%-15s%-2s%-6s%-40s%-20s%-60s%-1s%-1s%-8s%-2s%-1s\n",\
system_type ,\
seg_num ,\
sm_type ,\
msisdn ,\
other_party ,\
start_datetime ,\
end_datetime ,\
other_user_type ,\
send_status ,\
priority ,\
msg_length ,\
gateway_code ,\
f_gateway_code ,\
other_gateway ,\
sm_center_code ,\
user_type ,\
home_area_code ,\
fee1 ,\
old_fee1 ,\
substr(file_name,1,20) ,\
deal_time ,\
discount_type ,\
discount_order ,\
present_info ,\
sum_present_info,\
group_id ,\
product_code ,\
resv)
}' $1
}
#######################################


indir=$1
outdir=$2
bakdir=$3
find $indir/ -type f -name "*day.txt_sg" | while read line
do
basename $line | read file
deal $line >$outdir/wsg$file
mv $line $bakdir
done



#在awk中实现trim函数作用

echo " aa " | awk '
function trim(src)
{
sub(/[ ]+$/, "", src);
sub(/^[ ]+/, "", src);
return src;
}
{
bb=trim($0);
print bb
}'

########################shell脚本求取当前日期前一天
ingw2-billapp2:/work11/ruanxingke/shell>cat d.sh
GetMonth()
{
echo $1 $2 $3 | awk '{ year=$1;month=$2;day=$3;
if( day >= 2 )
{
day=day-1;
printf "%4s %02s %02s\n",year,month,day;
break;
}
if( day == 1 )
{
if(month == 1)
{
year=year-1;
month=12;
printf "%4s %02s %02s\n",year,month,"00";
break;
}
else
{
month=month-1;
printf "

上一页第5页

热门文档

相关文档

  • 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