I partly agree that there's a reason they came up with a new construct, it's clearer, simpler and easier to read.
But I think the advantages of the new construct will only be visible when you have to write complex commands. When there is a short command containing only one pair of ``, or only one $(), I even feel that the backtick way is easier to read. A dollar sign may indicate a lot of other constructs as well (depending on what comes next), whereas a backtick sign is unique. That's my feeling, others are free to feel different.
From your first posting in this thread (Try doing this with backticks:) it was not clear whether you doubted that it could be done at all, or in one short command. So I felt obliged to respond to your challenge. ;-)
And your first new example:
Code:
echo `rpm -ql \`rpm -qf \\\`which ls\\\`\``
Yes, this shows that using backticks becomes the clumsier the deeper nesting goes.
And sorry, your second example does not work in my bash. So there's no need for converting.
Did you try yourself?
First, grep gives you a string containing one ' sign,
and then echo will fail when processing this argument.
But to me, it seems that a correction for this failure is far beyond the scope of this thread.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.