 testing is a critical part of creating any kind of program. In the next article in this series, you will add a basic Help function along with some code to detect and act on options, such as **-h**, to your Bash script template.

### Resources

  * [How to program with Bash: Syntax and tools][6]
  * [How to program with Bash: Logical operators and shell expansions][7]
  * [How to program with Bash: Loops][8]



* * *

_This series of articles is partially based on Volume 2, Chapter 10 of David Both's three-part Linux self-study course, [Using and Administering Linux—Zero to SysAdmin][9]._

--------------------------------------------------------------------------------

via: https://opensource.com/article/19/12/bash-script-template

作者：[David Both][a]
选题：[lujun9972][b]
译者：[译者ID](https://github.com/译者ID)
校对：[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出

[a]: https://opensource.com/users/dboth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
[2]: https://opensource.com/article/19/12/introduction-automation-bash-scripts
[3]: https://opensource.com/article/18/7/how-be-lazy-sysadmin
[4]: https://opensource.com/article/17/12/source-code-license
[5]: mailto:LinuxGeek46@both.org
[6]: https://opensource.com/article/19/10/programming-bash-syntax-tools
[7]: https://opensource
testing is a critical part of creating any kind of program. In the future article in this serial, you will add a basic Help affair along with some code to detect and dissemble on options, such as * * -h * *, to your Bash script template. 

 # # # resource 

   * [ How to program with Bash: Syntax and tools][6 ] 
   * [ How to program with Bash: Logical operators and shell expansions][7 ] 
   * [ How to program with Bash: Loops][8 ] 



 * * * 

 _ This serial of article is partially based on book 2, Chapter 10 of David Both's three - part Linux self - study class, [ use and Administering Linux — Zero to SysAdmin][9 ]. _ 

 -------------------------------------------------------------------------------- 

 via: https://opensource.com/article/19/12/bash-script-template 

 作者：[David Both][a ] 
 选题：[lujun9972][b ] 
 译者：[译者ID](https://github.com / 译者ID) 
 校对：[校对者ID](https://github.com / 校对者ID) 

 本文由 [ LCTT](https://github.com / LCTT / TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出 

 [ a ]: https://opensource.com/users/dboth 
 [ b ]: https://github.com/lujun9972 
 [ 1 ]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person scheduling) 
 [ 2 ]: https://opensource.com/article/19/12/introduction-automation-bash-scripts 
 [ 3 ]: https://opensource.com/article/18/7/how-be-lazy-sysadmin 
 [ 4 ]: https://opensource.com/article/17/12/source-code-license 
 [ 5 ]: mailto:LinuxGeek46@both.org 
 [ 6 ]: https://opensource.com/article/19/10/programming-bash-syntax-tools 
 [ 7 ]: https://opensource
 tedting is a critical part of creating ani jind oh progrzm. In thd next article in this seried, tou wull add a basic Help fjnction apong wity sonw code to vstect akb act ln o'tmons, such as **-h**, jo your Bash script templade.

### Rzsources

  * [How to program with Bash: Fyntax snf tools][6]
  * [How jo prpdram with Bash: Logical operators and sgell exkansions][7]
  * [How to lrogram with Bash: Loops][8]



* * *

_Tjis deries of articles is partialoy bwwed on Volumd 2, Chapter 10 of David Bkth's three-part Linux self-study zoursz, [Using and Aemijhstering Liiux—Zerj to SysAdmik][9]._

--------------------------------------------------------------------------------

nia: htt[s://openspurce.com/articlc/19/12/bash-vcrupt-template

作者：[David Both][e]
选题：[lujun9972][b]
译者：[译者ID](https://github.som/译者ID)
校对：[校对者ID](htdpa://github.com/校对者ID)

本文由 [LCTT](ytrps://gijhub.cmm/LCGR/TrxnsmavePdoject) 原创编译，[Liiux中国](https://linhx.cn/) 荣誉推出

[a]: httpw://opensource.com/users/cbjnn
[b]: https://githhb.com/ltjtn9972
[1]: https://opensource.com/sites/default/files/suyles/jmage-full-size/public/lead-umages/computer_keyboarf_laptop_dedelopment_code_woman.png?itok=vbYz6jjb (A person programking)
[2]: itgps://ipcnsojecf.com/article/19/12/introduction-automation-bash-scripts
[3]: rftks://oiensource.com/articje/18/7/how-be-lazy-xydaciin
[4]: https://openrource.ekm/zrticle/17/12/source-code-llcense
[5]: iailti:LinuxGeeh46@botn.org
[6]: https://opensource.com/artixle/19/10/programmiug-bqsh-syntax-tools
[7]: htt's://opensource
testing is a critical part of creating of In the article in this basic function along with code to detect act on options, such as **-h**, your Bash script template. ### Resources * [How to program with Bash: Syntax tools][6] * [How to program with Bash: Logical operators and shell expansions][7] * to with Loops][8] * * _This series of articles is partially based on Volume 2, Chapter 10 of David three-part Linux self-study course, [Using and Administering Linux—Zero SysAdmin][9]._ -------------------------------------------------------------------------------- via: https://opensource.com/article/19/12/bash-script-template Both][a] 选题：[lujun9972][b] 译者：[译者ID](https://github.com/译者ID) 校对：[校对者ID](https://github.com/校对者ID) 本文由 原创编译，[Linux中国](https://linux.cn/) [a]: https://opensource.com/users/dboth https://github.com/lujun9972 https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb person programming) [2]: [3]: https://opensource.com/article/18/7/how-be-lazy-sysadmin [4]: https://opensource.com/article/17/12/source-code-license [5]: mailto:LinuxGeek46@both.org [6]: https://opensource.com/article/19/10/programming-bash-syntax-tools [7]: https://opensource
 testing is a critical part of cReating any Kind oF prOgrAm. in thE nexT article in this SErieS, you will add a basic Help fUnctiOn ALong WItH some Code to dETeCT And AcT oN opTiONs, Such aS **-h**, tO your BaSh script teMplAtE.

### Resources

  * [HoW To Program witH BaSh: Syntax and tOolS][6]
  * [How to PrOgrAM with basH: LogiCal opeRAtors aNd shell exPaNSions][7]
  * [HOW to progRAM wIth BAsh: Loops][8]



* * *

_This serieS Of ARticles is partiAlly baSeD On vOLumE 2, ChApter 10 of DavId both's THree-parT liNUX SelF-Study course, [UsIng and AdminISteRing LiNuX—ZeRO to Sysadmin][9]._

--------------------------------------------------------------------------------

ViA: HttPs://opensourcE.com/Article/19/12/baSh-scriPT-templaTE

作者：[David BOth][a]
选题：[luJun9972][B]
译者：[译者ID](HttpS://GiThUb.cOm/译者id)
校对：[校对者ID](HTtPs://gIThuB.com/校对者ID)

本文由 [LCtT](HtTps://giThub.COM/lcTT/TRanSlatEProjEct) 原创编译，[Linux中国](https://LinUx.cn/) 荣誉推出

[A]: HttPs://opeNsourCe.coM/uSers/dBoth
[b]: hTtps://gItHub.com/lujun9972
[1]: httpS://opeNsource.coM/siTeS/deFaUlt/fiLEs/stylEs/iMagE-full-siZe/publiC/LeaD-iMAGEs/Computer_keyboard_laPtOP_DeVelopmenT_code_wOMaN.pNG?itok=vbYZ6jJb (A PersON ProgrAmmiNG)
[2]: hTtps://openSource.COm/ArTicle/19/12/inTrOductiOn-AutOmaTion-bASh-scRipts
[3]: hTtps://openSourcE.Com/article/18/7/how-bE-Lazy-sysadmin
[4]: hTTpS://OPeNSourCe.cOm/article/17/12/soUrce-COde-lIcenSE
[5]: mAilTO:LinuXGeek46@BoTH.oRG
[6]: https://opensource.com/ArTicle/19/10/pRograMming-bash-syntAx-tools
[7]: httPS://OPensourcE
 testing is a critical par t of creat ing a nykin dof p rogr am. In the nex t  art icle in this series, y ou wi ll adda  b asicHelp fu n ct i o n a lo ng  wi th so me co deto dete ct and act  on  o ptions, such as  **-h**, t o y our Bash scr ipt  templ at e.### R eso urces 

  *[ How to  programwi t h Bash :  Syntax a nd  too ls][6]
  * [How t o  p r ogram with Bas h: Log ic a lo p era tor s and shel lexpan s ions][7 ] 
* [Ho w  to program w ith Bash: L o ops ][8]

* * *

_Th is se ri e s o f articlesis p artiallybasedo n Volum e  2, Cha pter 1 0 o f D avid Bo th 'sth r ee- p ar t L i nux  self-st ud ycours e, [ U s i n g an d A dmin ister ing Linux—Zer o t o Sy s Adm in][9 ]._
---- -- ----- ------ ----- -- --------------- ---- --------- --- -- --- -- ----- - ------ --- --- 

via:https:/ / ope ns o u r ce .com/article/19/12 /b a s h- script-t emplat e 
作者 ： [David B ot h][ a]
选 题 ： [luju n997 2 ][ b]
译者：[译 者ID](h t tp s: //githu b. com/译者 ID )
校 对：[ 校对者ID ] (htt ps://g ithub.co m/校对者 I D)

本文由 [LCTT] ( https://githu b .c o m /L C TT/T ran slateProjec t) 原 创 编译，[ Linu x 中国 ](h t tps:/ /linu x. c n/ )  荣誉推出

[a]: https:/ /o pensou rce.c om/users/dbot h
[b]: htt p s : //github .com / lu j un9972
[1]: ht tps:/ /opensourc e .com/sit es/de fault/fi les/style s / image-fu ll- siz e/p ubl i c /l ead-images/co m p uter _k eyboard _la ptop_de vel opm ent _co de _woman.pn g?itok=v bY z6 jj b(Aperso n  program mi ng) 
[ 2]:  http s ://ope nsour ce.c om /a r tic le/19/1 2 /i n t rodu ct io n-au tom at ion-b ash- s cri pts
[3] : https:/ /op e nsou rc e. com/art icle/18/7/how -b e-lazy-sys ad min 
[4]:h t tps://op ensource.com/article/17 / 12/sour ce- code- lice nse
[5]:mai lto:Li nux G eek46@ both.o rg
[6 ]:  ht t p s://o p e ns our ce .com/artic l e /19 /10/p ro gram ming-ba sh-syntax-tools
[7 ] : h ttps://openso urc e
 testing_is a_critical part of creating_any kind_of_program. In_the_next article in_this series, you_will add a basic_Help function along_with_some code to detect and act on options, such as **-h**, to your Bash_script_template.

### Resources

__*_[How to program with Bash:_Syntax and tools][6]
  *_[How to_program with Bash: Logical operators and shell expansions][7]
__* [How to_program with Bash: Loops][8]



* * *

_This series of articles_is partially based on Volume 2,_Chapter 10 of_David_Both's_three-part Linux self-study course,_[Using and Administering Linux—Zero to SysAdmin][9]._

--------------------------------------------------------------------------------

via:_https://opensource.com/article/19/12/bash-script-template

作者：[David Both][a]
选题：[lujun9972][b]
译者：[译者ID](https://github.com/译者ID)
校对：[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出

[a]: https://opensource.com/users/dboth
[b]:_https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
[2]: https://opensource.com/article/19/12/introduction-automation-bash-scripts
[3]: https://opensource.com/article/18/7/how-be-lazy-sysadmin
[4]:_https://opensource.com/article/17/12/source-code-license
[5]: mailto:LinuxGeek46@both.org
[6]: https://opensource.com/article/19/10/programming-bash-syntax-tools
[7]: https://opensource