They're not actually tokens in the lexer sense, except for the plain parenthesis (
and )
.
{
and }
in particular don't need any quoting at all:
$ echo {Hello World}
{Hello World}
(except if you have {
or }
as the first word of a command, where they're interpreted as keywords; or if you have {a,b}
in a single word with a comma or double-dot in between, where it's a brace expansion.)
[]
is also only special as a glob characters, and if there are no matching filenames, the default behaviour is to just leave the word as-is.
But anyway, to escape them, you'd usually quote them with single or double-quotes:
echo "(foo bar)"
echo '(foo bar)'
Or just escape the relevant characters one-by-one, though that's a bit weary:
echo \(foo\ bar\)
Or whatever combination you like:
echo \(fo"o bar"')'
See:
\(
, and so on. – AlainD Oct 21 '19 at 10:17