
On Fri, Dec 13, 2013 at 02:20:00PM +1100, Tim Connors wrote:
bash only. (ie, #!/bin/bash)
no, it's not. $() is POSIX standard. http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag... it's also supported by the korn shell. and bash too, of course. and zsh. see also: http://stackoverflow.com/questions/3789894/is-command-substitution-foo-bashi... also interesting: http://mywiki.wooledge.org/BashFAQ/082 http://www.in-ulm.de/~mascheck/various/cmd-subst/ http://utcc.utoronto.ca/~cks/space/blog/unix/PosixCommandSubstitution
1. backticks are pretty much deprecated. use $(...) instead - it's clearer/more readable, avoids most shell quoting/escaping problems, and can be nested.
Um, no, as I've said before, $() is a bashism. Yes it is neater,
you might have said it before but you were wrong then as you are wrong now. $() is NOT a bashism.
but try running that on HP-UX and see how well you go.
are you really running a pre-POSIX sh on HP-UX? that must be one truly ancient HPUX system. according to the man page at http://nixdoc.net/man-pages/hp-ux/man1/sh.1.html the original bourne sh was removed from HPUX starting with HP-UX 11i Version 1.5 and replaced with the POSIX sh. according to http://en.wikipedia.org/wiki/HP-UX 11i v1.5 was released in 2001. it's reasonable - and good practice - to point out REAL differences between POSIX sh and bash, but $() is not one of them. pre-POSIX versions of shell aren't in the least bit relevant to anyone running anything even resembling a modern "unix" system...and on linux (and *bsd) systems you'd be hard-pressed to find any kind of sh that wasn't POSIX (e.g. dash) or a superset of POSIX (e.g. bash). craig -- craig sanders <cas@taz.net.au>