Fish equivalent of bash $(command) notation
Since fish 3.4 (released March 2022), $()
-substitution is supported. It works the same as ()
-substitution, but can be used inside double-quoted strings.
FYI: If you additionally need to use this inside a string:
echo "Found "(count $PATH)" paths in PATH env var"
In fish, $
is used only for variables. Correct notation equivalent to bash $(command)
is just (command)
in fish.