[svlug] Evil Backquotes (was Re: how to copy a bunch of "." files?)
xtifr at dsp.net
Sun May 14 16:14:39 PDT 2000
Tin Le <tin at le.org> writes:
> Ksh (Korn shell) came around 1986 (outside of Bell Lab that is) from David
Hmm, I thought I started using it before then. Maybe not -- my first
exposure might have been as late as '88. (On an MS-DOS system running
Mortice Kern's DOS toolkit; our *NIX boxes were still running Xenix at
that point, which had only a seriously limited sh and an ugly csh.)
> It went back a long way. The way I was taught was that sh is for writing
> scripts and csh is only for interactive use.
That is a piece of "recieved wisdom" which I would like to do
everything in my power to stamp out. It was true back in the days I
was running Xenix, but, in my opinion, since at least the introduction
of ksh, there has been no justification whatsoever for the existence
of csh, except force of habit. Newbies should be told to avoid csh at
all costs. Then, with any luck, the last of the old hackers who still
find themselves wed to it will die out before long... :-)
I don't allow any form of csh to be installed on my workstations or on
any production servers I'm in charge of. Period.
> You would have to go back pretty far to find a system still running
> versions of sh that does not support the back tick.
Not very far at all, at least not on HPuchhs systems. Ksh introduced
$(), and to the best of my knowledge, there are still systems today
that have support for $() but *not* for backticks. If that's changed,
it's been in the last couple of years.
> I can't speak for other people, but I tried to write portable scripts that
> will run in Bourne shell. If it run in sh, it will run in bash and ksh.
> This mean avoiding unneeded features like the plague.
Yup, and this is another reason I try to stick with $() instead of
backticks. Of course, the primary reason is that $() is more
readable and more flexible (supports nesting).
I have never seen a bourne-shell compatible (or near-compatible like
ksh) that supported backticks and didn't support $(). I have seen
ones which support $() and not backticks. (And ones which support
neither, but those *are* basically obsolete enough to ignore at this
Thus, the aesthetics of portability and elegance unite in proclaiming
that $() is the One True Way, and that backticks are Evil. :-)
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