On 7/28/06, Charles Curley <[EMAIL PROTECTED]> wrote:
Because
* Back ticks are deprecated, and in future may be used for something
else.
* One can nest $(), but not back ticks.
* In some fonts, back ticks may be confused with ticks, producing
programming errors, where in most fonts parentheses are not easily
confused with other characters.
* $() shows up better when one uses Emacs' parentheses matching minor
mode.
Great, I'm convinced, now let's try this on a true Bourne Shell (not
bash's symlink named sh).
sh> ls $(echo /etc)
syntax error: '(' unexpected
sh> ls `echo /etc`
... ls output ...
$() works in bash (and bash's version of /bin/sh) but it doesn't work
in the original bourne shell. I like my shell scripts to be as
portable as possible. I work primarily on Linux, but I also work with
AIX and Solaris -- no bash by default there. This is a moot point
because most unices have bash or can have bash installed, but still
it's not all ranbow skittles.
Back ticks are the standard and they work in every shell I've ever
used (sh, bash, ksh, csh, zsh, etc). $() only works in some shells
(bash, ksh, zsh?).
-Bryan
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/