As funções em bash
são essencialmente denominadas comandos compostos (ou blocos de código). De man bash
:
Compound Commands
A compound command is one of the following:
...
{ list; }
list is simply executed in the current shell environment. list
must be terminated with a newline or semicolon. This is known
as a group command.
...
Shell Function Definitions
A shell function is an object that is called like a simple command and
executes a compound command with a new set of positional parameters.
... [C]ommand is usually a list of commands between { and }, but
may be any command listed under Compound Commands above.
Não há motivo, é apenas a sintaxe.
Como a lista na função de linha única fornecida não termina com uma nova linha ou a ;
, bash
reclama.