欢迎来到天天文库
浏览记录
ID:51489849
大小:363.74 KB
页数:5页
时间:2020-03-25
《UNIX(AIX)SHELL编程实现系统检查脚本.pdf》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Blog:tomroom.cublog.cnUNIX(AIX)SHELL编程实现系统检查脚本进阶实例tomroom环保男UNIX(AIX)SHELL编程实现系统检查脚本进阶实例说明:Unix(aix)编程开头难,下面把常用系统检查命令脚本拆开逐个逐步解释,举一反三例子运行环境:IBMUNIX(AIX)6.1环境,2012-3-1lastupdate1)wc命令(wordcount)可以统计file或者前面命令输出结果的行数或者字数#dfFilesystem512-blocksFree%UsedIused%IusedMountedon/dev/hd410485760963620
2、89%134722%//dev/hd27340032128305683%4996026%/usr/dev/hd9var4194304299992829%95553%/var/dev/hd3314572802556261619%4721%/tmp/dev/hd1230686721667161628%771%/home/dev/hd11admin5242885235201%51%/admin/proc-----/proc/dev/hd10opt16777216432891275%7115813%/opt/dev/livedump5242885235521%41%/var/adm/
3、ras/livedump/dev/fslv00157286449713669%971%/wujtest/dev/fslv015242885234801%111%/test/dev/fslv02419430441930081%41%/nmon/dev/fslv032097152001968290327%16011%/doc#df
4、wc-l14上面统计df命令输出数量14行2)sed命令(streamedit)文件或者前面命令输出结果的字符串处理,用其中1d参数可以去掉df命令运行结果的第一行表头。sed还可以字符替换并写入到另外一个文件等操作,下面是man附录信息Thesedc
5、ommandmodifieslinesfromthespecifiedFileparameteraccordingtoaneditscriptandwritesthemtostandardoutput.Thesedcommandincludesmanyfeaturesforselectinglinestobemodifiedandmakingchangesonlytotheselectedlines.Thesedcommandusestwoworkspacesforholdingthelinebeingmodified:thepatternspace,wherethesele
6、ctedlineisheld;andtheholdspace,wherealinecanbestoredtemporarily.Aneditscriptconsistsofindividualsubcommands,eachoneonaseparateline.Thegeneralformofsedsubcommandsisthefollowing:[address-range]function[modifiers]#dfFilesystem512-blocksFree%UsedIused%IusedMountedon/dev/hd41048576096362089%1347
7、22%//dev/hd27340032128305683%4996026%/usr/dev/hd9var4194304300276829%95673%/var/dev/hd3314572802556257619%4731%/tmp1Blog:tomroom.cublog.cnUNIX(AIX)SHELL编程实现系统检查脚本进阶实例tomroom环保男/dev/hd1230686721667161628%771%/home/dev/hd11admin5242885235201%51%/admin/proc-----/proc/dev/hd10opt167772164314568
8、75%7115913%/opt/dev/livedump5242885235521%41%/var/adm/ras/livedump/dev/fslv00157286449713669%971%/wujtest/dev/fslv015242885234801%111%/test/dev/fslv02419430441930081%41%/nmon/dev/fslv032097152001968290327%16011%/doc#df
9、sed1d/dev/hd41048576096362089%13472
此文档下载收益归作者所有