5 ms·
> "This is how one can tell a rookie just learning to program in shell: usage of $() syntax is limited to Bourne family of shells which implement that particula
by posix_me_less 8y ago
> "This is how one can tell a rookie just learning to program in shell: usage of $() syntax is limited to Bourne family of shells which implement that particular POSIX specification aspect. Backticks, on the other hand, although they incur a performance penalty since they spawn a subshell, make one's code instantly portable across all UNIX-like operating systems and even across disparate shell families, as they work exactly the same in C-shells."
The '$()' notation is a standard shell feature de facto. The fraction of people who care about their script working on all UNIX-like operating systems' default shells is very close to 0. The recommendation is fine - this notation is more readable and nestable.
> "Always test your shell code on a traditional UNIX like HP-UX or a Solaris derivative like SmartOS if possible, with a real Bourne shell."
Only if your script needs to be "original Bourne shell" compatibile. Which is almost never for most script writers.
- Annatar 8y ago“Long live the GNU/Linux hegemony and monoculture, the only truth and true religion”. Lovely.
- posix_me_less 8y agoLong live the inventiveness and free spirit of contributors who brings us useful improvements and progress to what would otherwise be a cumbersome legacy computer interface.
- Annatar 8y agoWhich interface? Are you sure you could not have made a broader generalization and a more nondescript statement?