Skip to content

Bash docs

When to use {}

The {} in ${} are useful if you want to expand the variable foo in the string

When to use [] and ()

  1. [] : The opening bracket ([) is an alias for the test command which performs all the tests and returns 0 for true or something else for false. The “if” reacts only to the return value of the test command. The closing bracket tells test where the expression ends. The double brackets ([[) are a bash built in and can replace the external call to test.

https://stackoverflow.com/questions/11796751/what-does-do-in-bash

  1. (): Calls sub shell

https://stackoverflow.com/questions/11796751/what-does-do-in-bash

Improve at shell scripting

  1. Apply existing tools to particular problems
  2. https://www.johndcook.com/blog/2019/02/18/command-line-wizard/?utm_source=hackernewsletter&utm_medium=email&utm_term=fav