Skip to content

Files

Latest commit

 

History

History
30 lines (20 loc) · 460 Bytes

SC2129.md

File metadata and controls

30 lines (20 loc) · 460 Bytes

Pattern: Ungrouped >> redirects

Issue: -

Description

Rather than adding >> something after every single line, you can simply group the relevant commands and redirect the group.

Example of incorrect code:

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

Example of correct code:

{
  echo foo
  date
  cat stuff
} >> file

Further Reading