Illegal characters (newline
or |
, &
, ;
, <
, >
, (
, )
, {
, }
) need to be escaped. This is done by prefixing them with \
.
Verbatim from man wordexp
:
The string argument
Since the expansion is the same as the expansion by the shell (see sh(1)) of the parameters to a command, the string s must not contain characters that would be illegal in shell command parameters. In particular, there must not be any unescaped newline or |, &, ;, <, >, (, ), {, } characters outside a command substitution or parameter substitution context.