As novas linhas são excluídas pela substituição de comando $()
. A manpage de bash diz:
Command substitution allows the output of a command to replace the command name. There are two forms:
$(command)
or
'command'
Bash performs the expansion by executing command in a subshell environment and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).