In sh:
~$ `echo ls`
bin/ Desktop/
But in fish:
fish: Illegal command name “(echo ls)”
~% (echo ls)
(Note
It has to do with the order of expansions.
From help expand-command-substitution
in fish
:
When combining multiple parameter expansions, expansions are performed in the following order:
* Command substitutions
* Variable expansions
* Bracket expansion
* Pid expansion
* Wildcard expansion
Expansions are performed from right to left, nested bracket expansions are performed from the inside and out.
From man bash
:
The order of expansions is: brace expansion, tilde expansion, parameter, variable and arithmetic expansion and command substitution (done in a left-to-right fashion), word splitting, and pathname expansion.