Shell

Shell

Made by DeepSource

Consider grouping multiple command redirects SH-2129

Performance
Minor

Rather than adding >> something after every single line, you can simply group the relevant commands and redirect the group. Now the file has to be opened and closed only once, which can be a performance gain.

Bad Practice

echo foo >> file
date >> file
cat stuff  >> file

Recommended:

{
  echo foo
  date
  cat stuff
} >> file

References