[svlug] Evil Backquotes (was Re: how to copy a bunch of "." files?)

Chris Waters xtifr at dsp.net
Sat May 13 11:11:16 PDT 2000

dfox at belvdere.vip.best.com writes:

[someone unattributed (possibly Jeffrey Siegal) was quoted saying:]
> > line limit (which was pretty small on legacy Unix systems), you could
> > just do something like 

> >   grep pattern /dev/null `find ... -print`

> That's essentially how I do things. I find the backquotes cleaner than
> the find(1) syntax  [...]

Actually, backquotes are NOT very clean at all.  I've said this
before, but I think it's time to say it again.

As far as I know, they're non-standard -- they certainly they don't
work in many ksh's.  And they're hard for the eye to distinguish from
other quotes.  Mix-and-match with backquotes is a nightmare.  And
finally, they cannot be nested.  Which is a serious and frequently
annoying limitation.  (Especially after you're used to a system where
the equivalent can be nested.)

Use $() instead -- it solves all these problems, in a POSIX-compliant,
ksh-compatible manner.  $(), IMO, makes it much more clear that
something extraordinary is going on.  And only requires typing one
additional character -- a miniscule price to pay for all the benefits
in clarity and flexibility.

Just say no to backticks. :-)
Chris Waters   xtifr at dsp.net | I have a truly elegant proof of the
      or    xtifr at debian.org | above, but it is too long to fit into
http://www.dsp.net/xtifr     | this .signature file.

More information about the svlug mailing list