欢迎来到人人文库网! | 帮助中心 人人文库renrendoc.com美如初恋!
人人文库网
首页 人人文库网 > 资源分类 > DOC文档下载

外文翻译--高级Bash脚本编程指南一个对脚本编程技术的深入讨论.doc

  • 资源大小:32.50KB        全文页数:6页
  • 资源格式: DOC        下载权限:游客/注册会员/VIP会员    下载费用:5
游客快捷下载 游客一键下载
会员登录下载
下载资源需要5

邮箱/手机号:
您支付成功后,系统会自动为您创建此邮箱/手机号的账号,密码跟您输入的邮箱/手机号一致,以方便您下次登录下载和查看订单。注:支付完成后需要自己下载文件,并不会自动发送文件哦!

支付方式: 微信支付    支付宝   
验证码:   换一换

友情提示
2、本站资源不支持迅雷下载,请使用浏览器直接下载(不支持QQ浏览器)
3、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰   

外文翻译--高级Bash脚本编程指南一个对脚本编程技术的深入讨论.doc

附录外文资料翻译原文部分ADVANCEDBASHSCRIPTINGGUIDEANINDEPTHEXPLORATIONOFTHEARTOFSHELLSCRIPTING1INTRODUCTIONTHESHELLISACOMMANDINTERPRETERMORETHANJUSTTHEINSULATINGLAYERBETWEENTHEOPERATINGSYSTEMKERNELANDTHEUSER,ITSALSOAFAIRLYPOWERFULPROGRAMMINGLANGUAGEASHELLPROGRAM,CALLEDASCRIPT,ISANEASYTOUSETOOLFORBUILDINGAPPLICATIONSBYGLUINGTOGETHERSYSTEMCALLS,TOOLS,UTILITIES,ANDCOMPILEDBINARIESVIRTUALLYTHEENTIREREPERTOIREOFUNIXCOMMANDS,UTILITIES,ANDTOOLSISAVAILABLEFORINVOCATIONBYASHELLSCRIPTIFTHATWERENOTENOUGH,INTERNALSHELLCOMMANDS,SUCHASTESTINGANDLOOPCONSTRUCTS,GIVEADDITIONALPOWERANDFLEXIBILITYTOSCRIPTSSHELLSCRIPTSLENDTHEMSELVESEXCEPTIONALLYWELLTOADMINISTRATIVESYSTEMTASKSANDOTHERROUTINEREPETITIVEJOBSNOTREQUIRINGTHEBELLSANDWHISTLESOFAFULLBLOWNTIGHTLYSTRUCTUREDPROGRAMMINGLANGUAGE2WHYSHELLPROGRAMMINGAWORKINGKNOWLEDGEOFSHELLSCRIPTINGISESSENTIALTOANYONEWISHINGTOBECOMEREASONABLYPROFICIENTATSYSTEMADMINISTRATION,EVENIFTHEYDONOTANTICIPATEEVERHAVINGTOACTUALLYWRITEASCRIPTCONSIDERTHATASALINUXMACHINEBOOTSUP,ITEXECUTESTHESHELLSCRIPTSIN/ETC/RCDTORESTORETHESYSTEMCONFIGURATIONANDSETUPSERVICESADETAILEDUNDERSTANDINGOFTHESESTARTUPSCRIPTSISIMPORTANTFORANALYZINGTHEBEHAVIOROFASYSTEM,ANDPOSSIBLYMODIFYINGITWRITINGSHELLSCRIPTSISNOTHARDTOLEARN,SINCETHESCRIPTSCANBEBUILTINBITESIZEDSECTIONSANDTHEREISONLYAFAIRLYSMALLSETOFSHELLSPECIFICOPERATORSANDOPTIONSTOLEARNTHESYNTAXISSIMPLEANDSTRAIGHTFORWARD,SIMILARTOTHATOFINVOKINGANDCHAININGTOGETHERUTILITIESATTHECOMMANDLINE,ANDTHEREAREONLYAFEWRULESTOLEARNMOSTSHORTSCRIPTSWORKRIGHTTHEFIRSTTIME,ANDDEBUGGINGEVENTHELONGERONESISSTRAIGHTFORWARDASHELLSCRIPTISAQUICKANDDIRTYMETHODOFPROTOTYPINGACOMPLEXAPPLICATIONGETTINGEVENALIMITEDSUBSETOFTHEFUNCTIONALITYTOWORKINASHELLSCRIPTISOFTENAUSEFULFIRSTSTAGEINPROJECTDEVELOPMENTTHISWAY,THESTRUCTUREOFTHEAPPLICATIONCANBETESTEDANDPLAYEDWITH,ANDTHEMAJORPITFALLSFOUNDBEFOREPROCEEDINGTOTHEFINALCODINGINC,C,JAVA,ORPERLSHELLSCRIPTINGHEARKENSBACKTOTHECLASSICUNIXPHILOSOPHYOFBREAKINGCOMPLEXPROJECTSINTOSIMPLERSUBTASKS,OFCHAININGTOGETHERCOMPONENTSANDUTILITIESMANYCONSIDERTHISABETTER,ORATLEASTMOREESTHETICALLYPLEASINGAPPROACHTOPROBLEMSOLVINGTHANUSINGONEOFTHENEWGENERATIONOFHIGHPOWEREDALLINONELANGUAGES,SUCHASPERL,WHICHATTEMPTTOBEALLTHINGSTOALLPEOPLE,BUTATTHECOSTOFFORCINGYOUTOALTERYOURTHINKINGPROCESSESTOFITTHETOOLWHENNOTTOUSESHELLSCRIPTSRESOURCEINTENSIVETASKS,ESPECIALLYWHERESPEEDISAFACTORSORTING,HASHING,ETCPROCEDURESINVOLVINGHEAVYDUTYMATHOPERATIONS,ESPECIALLYFLOATINGPOINTARITHMETIC,ARBITRARYPRECISIONCALCULATIONS,ORCOMPLEXNUMBERSUSECORFORTRANINSTEADCROSSPLATFORMPORTABILITYREQUIREDUSECORJAVAINSTEADCOMPLEXAPPLICATIONS,WHERESTRUCTUREDPROGRAMMINGISANECESSITYNEEDTYPECHECKINGOFVARIABLES,FUNCTIONPROTOTYPES,ETCMISSIONCRITICALAPPLICATIONSUPONWHICHYOUAREBETTINGTHERANCH,ORTHEFUTUREOFTHECOMPANYSITUATIONSWHERESECURITYISIMPORTANT,WHEREYOUNEEDTOGUARANTEETHEINTEGRITYOFYOURSYSTEMANDPROTECTAGAINSTINTRUSION,CRACKING,ANDVANDALISMPROJECTCONSISTSOFSUBCOMPONENTSWITHINTERLOCKINGDEPENDENCIESEXTENSIVEFILEOPERATIONSREQUIREDBASHISLIMITEDTOSERIALFILEACCESS,ANDTHATONLYINAPARTICULARLYCLUMSYANDINEFFICIENTLINEBYLINEFASHIONNEEDNATIVESUPPORTFORMULTIDIMENSIONALARRAYSNEEDDATASTRUCTURES,SUCHASLINKEDLISTSORTREESNEEDTOGENERATEORMANIPULATEGRAPHICSORGUISNEEDDIRECTACCESSTOSYSTEMHARDWARENEEDPORTORSOCKETI/ONEEDTOUSELIBRARIESORINTERFACEWITHLEGACYCODEPROPRIETARY,CLOSEDSOURCEAPPLICATIONSSHELLSCRIPTSPUTTHESOURCECODERIGHTOUTINTHEOPENFORALLTHEWORLDTOSEEIFANYOFTHEABOVEAPPLIES,CONSIDERAMOREPOWERFULSCRIPTINGLANGUAGEPERHAPSPERL,TCL,PYTHON,RUBYORPOSSIBLYAHIGHLEVELCOMPILEDLANGUAGESUCHASC,C,ORJAVAEVENTHEN,PROTOTYPINGTHEAPPLICATIONASASHELLSCRIPTMIGHTSTILLBEAUSEFULDEVELOPMENTSTEPWEWILLBEUSINGBASH,ANACRONYMFORBOURNEAGAINSHELLANDAPUNONSTEPHENBOURNESNOWCLASSICBOURNESHELLBASHHASBECOMEADEFACTOSTANDARDFORSHELLSCRIPTINGONALLFLAVORSOFUNIXMOSTOFTHEPRINCIPLESTHISBOOKCOVERSAPPLYEQUALLYWELLTOSCRIPTINGWITHOTHERSHELLS,SUCHASTHEKORNSHELL,FROMWHICHBASHDERIVESSOMEOFITSFEATURES,ANDTHECSHELLANDITSVARIANTSNOTETHATCSHELLPROGRAMMINGISNOTRECOMMENDEDDUETOCERTAININHERENTPROBLEMS,ASPOINTEDOUTINANOCTOBER,1993USENETPOSTBYTOMCHRISTIANSENWHATFOLLOWSISATUTORIALONSHELLSCRIPTINGITRELIESHEAVILYONEXAMPLESTOILLUSTRATEVARIOUSFEATURESOFTHESHELLTHEEXAMPLESCRIPTSWORKTHEYVEBEENTESTED,INSOFARASWASPOSSIBLEANDSOMEOFTHEMAREEVENUSEFULINREALLIFETHEREADERCANPLAYWITHTHEACTUALWORKINGCODEOFTHEEXAMPLESINTHESOURCEARCHIVESCRIPTNAMESHORSCRIPTNAMEBASH,GIVETHEMEXECUTEPERMISSIONCHMODURXSCRIPTNAME,THENRUNTHEMTOSEEWHATHAPPENSSHOULDTHESOURCEARCHIVENOTBEAVAILABLE,THENCUTANDPASTEFROMTHEHTML,PDF,ORTEXTRENDEREDVERSIONSBEAWARETHATSOMEOFTHESCRIPTSPRESENTEDHEREINTRODUCEFEATURESBEFORETHEYAREEXPLAINED,ANDTHISMAYREQUIRETHEREADERTOTEMPORARILYSKIPAHEADFORENLIGHTENMENT外文资料翻译译文部分高级BASH脚本编程指南一个对脚本编程技术的深入讨论1简介SHELL是一个命令解释器。它是操作系统内核和用户之间的绝缘层,也是一种功能强大的编程语言。一个SHELL程序,通常被称作为脚本,它是由系统调用,命令工具,软件包和已编译的二进制包结合起来的容易使用的工具。事实上,SHELL脚本可以调用整个UNIX系统命令,软件包和工具。如果这还不太够的话,SHELL的内部命令,如测试和循环结构,都使得SHELL脚本更强大和更有弹性。SHELL脚本在管理系统任务中表现得非常出色,在对日常反复性的处理工作中避免使用那些结构复杂的程序语言。2为什么要用SHELL编程脚本应用知识对希望精通系统管理的任何个人说是必需的,他实际上不想写一个脚本程序。一般说一个LINUX机器启动后,它会执行在/ETC/RCD目录下的SHELL脚本重建系统环境并且启动各种服务。理解这些启动脚本的细节对分析系统运作并修改它是有很大意义的。编写SHELL脚本并不难学,因为脚本内建的功能集(CHECK)和他们只要学相当少的SHELL的操作符和选项。语法简单易懂,像在命令行上调用和连接软件包那样容易,它只有少量的规则需要掌握。大多数短小的脚本第一次就工作的很好,较长的脚本调试也相当的容易。SHELL脚本是个复杂应用原型的QUICKANDDIRTY方法。在项目开发中用SHELL编程实现个有限的功能性子集是有用的开始。用这种方法去测试应用程序的结构和模块组合,可以在实际地用C,C,JAVA或者PERL进行编程之前发现主要的设计缺陷。SHELL编程遵从经典UNIX哲学把复杂的问题分成简单的小问题,然后再把各部分功能组合起来解决复杂问题。这和用新一代高级的多用途的语言,例如PERL,试图成为所有人处理所有事情的语言但是所付出的代价是强迫改变你的思维方法来适应这种工具,大多数人认为这是一个更好的或者至少感觉上更令人能

注意事项

本文(外文翻译--高级Bash脚本编程指南一个对脚本编程技术的深入讨论.doc)为本站会员(淘宝运营)主动上传,人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知人人文库网(发送邮件至[email protected]或直接QQ联系客服),我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。

关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服客服 - 联系我们

网站客服QQ:2846424093    人人文库上传用户QQ群:460291265   

[email protected] 2016-2018  renrendoc.com 网站版权所有   南天在线技术支持

经营许可证编号:苏ICP备12009002号-5