30 hours ago
This question is loosely related to one of my previous ones. TL;DR from muru's answer is that characters in function name have to be on Portable Character Set in order to be valid for a function name. Problem is that space is on the list (the <space> or <U0020> character), which is why I'm confused as to why I can't do this:
<space>
<U0020>
$ $' '(){ echo "Hullo";} bash: `' '': not a valid identifier $ hello$' 'world(){ echo "hi";} bash: `hello' 'world': not a valid identifier
With other shells:
$ mksh -c '\ (){ echo "Hello";} ' mksh: : invalid function name $ ksh -c '\ (){ echo "Hello";} ' ksh: : invalid function name $ dash -c '\ (){ echo "Hello";} ' dash: 1: Syntax error: Bad function name
14 hours ago
Let me stress the relevant part:
a word consisting solely of underscores, digits, and alphabetics from the portable character set
Other characters in the portable character set are not allowed. Character being in the portable character set is a necessary, but not sufficient, condition.