The part of this question that interests me most is why "running
echo $
returns
$
"--that is, why is
$
by itself is treated literally, rather than being considered a bad substitution like
${}
? (
$
by itself can't be expanded, and is treated literally;
${}
can't be expanded, and is an error.) If this is reopened, perhaps additional answers will be posted to explain that. I can sort of address this--
$x
is actually a short form of
${x}
where x
is a valid parameter name--but I suspect others might be able to explain it from a more historical, formal, or practical perspective. —
Eliah Kagan Aug 8 at 5:44