100
101const genDecMapTmpl = \`
102EOF
103 cat >> gen.generated.go < gen-dec-map.go.tmpl104 cat >> gen.generated.go <<EOF
105\`
106
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.
echo foo >> file
date >> file
cat stuff >> file
{
echo foo
date
cat stuff
} >> file