From d79bbdd53b785e7298951b1f4aa75d7a02442c1b Mon Sep 17 00:00:00 2001 From: "D. Kasi Pavan Kumar" <44864604+kasipavankumar@users.noreply.github.com> Date: Mon, 7 Sep 2020 23:29:25 +0530 Subject: [PATCH] fix(typo): three typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes include: 1. Added one missing closing parenthesis on line 49. 2. Two typo fixes: a. Variabless → Variables b. Undbound → Unbound --- docs/Bash.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Bash.md b/docs/Bash.md index db50b66..d8412f8 100644 --- a/docs/Bash.md +++ b/docs/Bash.md @@ -46,13 +46,13 @@ An attempt to bring order in good advice on writing Bash scripts I collected fro - Prefer local variables within functions over global variables - If you need global variables, make them readonly -- Variables should always be referred to in the `${var}` form (as opposed to `$var`. +- Variables should always be referred to in the `${var}` form (as opposed to `$var`). - Variables should always be quoted, especially if their value may contain a whitespace or separator character: `"${var}"` - Capitalization: - Environment (exported) variables: `${ALL_CAPS}` - Local variables: `${lower_case}` - Positional parameters of the script should be checked, those of functions should not -- Some loops happen in subprocesses, so don’t be surprised when setting variabless does nothing after them. Use stdout and `grep`ing to communicate status. +- Some loops happen in subprocesses, so don’t be surprised when setting variables does nothing after them. Use stdout and `grep`ing to communicate status. ## Substitution @@ -162,7 +162,7 @@ Bash is not very easy to debug. There's no built-in debugger like you have with - Always check for syntax errors by running the script with `bash -n myscript.sh` - Use [ShellCheck](https://www.shellcheck.net/) and fix all warnings. This is a static code analyzer that can find a lot of common bugs in shell scripts. Integrate ShellCheck in your text editor (e.g. Syntastic plugin in Vim) -- Abort the script on errors and undbound variables. Put the following code at the beginning of each script. +- Abort the script on errors and unbound variables. Put the following code at the beginning of each script. ```bash set -o errexit # abort on nonzero exitstatus