About
This page shows you how to define a block of code in bash
A non-anonymous block is a function.
What is the syntax?
The block syntax is:
{
# your code
}
Example
Redirect Stdout
{
cat <<-EOH
#
# THIS IS A comment
#
EOH
echo Another
} > "/path/to/file"
Can I use the subshell syntax?
You can use the subshell syntax but you will not get any return status (meaning that you can't exit)
(
# your code
)