CODEX

A Bash Template(cheat sheet) is very Useful

How a Bash Template Speeds Up my Work

Stefanie Lai
CodeX
Published in
7 min readMar 4, 2021

--

a pizza template,add what you like

As a PaaS developer, writing shell scripts is inevitable, though I only need to write them very occasionally, once a month maybe. I can’t say it is tough but admit it is not easy. The reasons are

  • It takes your effort to adapt to the syntax since it is different from commonly used high-level languages.
  • To be proficient in writing, you need to master more built-in variables.
  • Debug is always not easy.
  • Be cautious about error control. Extra attention is required when it comes to files deletion.

Deeply addicted to Google at the beginning of my writing shell scripts, I did it in low efficiency. “Time to step out of the comfort zone,” I said to myself. There are always rules, conventional syntax, and tools that help you be a real shell script “writer.” Here’s my experience of no longer being a Google dependant.

  • Rely on a template. It is most conventional shell scripts’ structure and content, around which you can do subsequent modifications.
  • Make a list with things easy to confuse or difficult to remember. By reviewing the list time after time, you gradually “carve” them into your brain cells.

--

--