Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> fish’s command substitution syntax has been extended: $(cmd) now has the same meaning as (cmd) but it can be used inside double quotes

That's pretty big news for a more POSIX-like behaviour!



They did it also because with the old syntax it was unintuitive how to put commands inside quotes. It borrowed the new syntax from bash but it wasn't ONLY to be more bash compatible. It solved a real fish shell problem also.


Nitpick: The $(…) syntax was not invented by GNU, it was invented by Kenneth Almquist at the University of Washington.

https://www.in-ulm.de/~mascheck/various/ash/#original


They've been doing these small improvements to support more standard syntax for a while and I approve. (e.g. 3.0 added &&/|| as aliases for and/or, 3.1 added &> redirection syntax, and "X=Y foo" for setting variables for one command)


Copy-pasting little snippets with `"$(command)"` in them has always been a bit of annoyance. Happy to see it improving!


Agreed with it. It is the highlight of this release.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: